Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Swap custom and transform processors in pipeline #255

Merged
merged 1 commit into from
Nov 12, 2024

Conversation

obs-gh-enricogiorio
Copy link
Collaborator

The reason is that the custom processor might edit the log body in-place and the transform processor will copy parts of the body over to the facets. Since the transform processor is more flexible, we want to edit things first and eventually add them as facets once they are modified.

Example: secrets obfuscation. We want to redact the secrets' values that can show up in the annotations. The transform processor blindly copies the annotations to facets. So we don't want the secrets to show up in the facets un-redacted.

@obs-gh-enricogiorio
Copy link
Collaborator Author

This will only work once we release the agent with the "structured log body" patch.
The custom processor that we are moving before the transform processor is currently overriding the log body with a "flat" string, which precents the transform processor from indexing into it and do its thing.
I have a patch that makes the custom processor override the log body with a structured map[string]any, instead, which will allow the transform processor to do things on top of it.
Once that's merged, we will make a new public agent release, and then merge this fix here!

The observek8sattributes processor might edit the log body in-place,
which might affect the value of facets computed by transform/object.

Therefore, we swap the two processors in the pipeline to make sure
observek8sattributes always acts before transform/object.
@obs-gh-enricogiorio
Copy link
Collaborator Author

image Local testing: my cluster sends Secret entities with obfuscated secrets' values in the facets after swapping processors.

@obs-gh-enricogiorio obs-gh-enricogiorio merged commit 7a4171a into main Nov 12, 2024
11 checks passed
@obs-gh-enricogiorio obs-gh-enricogiorio deleted the enrico/swapProcessors branch November 12, 2024 12:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants