-
Notifications
You must be signed in to change notification settings - Fork 77
[transformation_test] Support testing LoggingFilesProcessorMacro receivers.
#2013
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
[transformation_test] Support testing LoggingFilesProcessorMacro receivers.
#2013
Conversation
LoggingReceiverFiles like receivers.LoggingFilesProcessorMacro receivers.
…d/or a `receiver`.
…r + processor` combos to tests.
b15bdd1 to
1476598
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why can't these apps just use LoggingProcessorParseMultilineRegex instead of making all these changes to hack together support for manipulating file receivers?
Why
|
| if len(r.MultilineRules) > 0 { | |
| // Configure multiline in the input component; | |
| // This is necessary, since using the multiline filter will not work | |
| // if a multiline message spans between two chunks. | |
| rules := [][2]string{} | |
| for _, rule := range r.MultilineRules { | |
| rules = append(rules, [2]string{"rule", rule.AsString()}) | |
| } | |
| parserName := fmt.Sprintf("multiline.%s", tag) | |
| c = append(c, fluentbit.Component{ | |
| Kind: "MULTILINE_PARSER", | |
| Config: map[string]string{ | |
| "name": parserName, | |
| "type": "regex", | |
| "flush_timeout": "5000", | |
| }, | |
| OrderedConfig: rules, | |
| }) |
Answer
Re @quentinmit :
Why can't these apps just use
LoggingProcessorParseMultilineRegexinstead of making all these changes to hack together support for manipulating file receivers?
I haven't considered so far (though it is indeed possible) to change / refactor the main 3P app processor logic at all. This implies work on "3p app receivers fluent-bit logic" rather than "refactoring 3P receivers for Otel Logging", so it would be additional effort.
Currently, I was considering it would be better to support 3P receivers for transformation testing which extends our testing possibilities, rather than considering working on Fluent-bit specific questions like "Does moving 'multiline.parsing' out of the input will still handle long-multiline logs correctly through multiple chunks and same performance ?".
I'm weighing as valuable to keep the same fluent-bit processor logic (same user feature expectations) and proposing this PR (we could improve) as a way to achieve that.
With this considerations, do you think its better to work on refactoring fluent-bit multiline parsing instead of the approach of this PR ?
Yeah, I know about that bug. But we already have a pattern to resolve that: ops-agent/confgenerator/config.go Lines 599 to 604 in 3ed6d7e
We can apply the same logic to logging receivers, which would allow the multiline parser to be configured as part of the file receiver to work around the fluent-bit bug.
I don't believe my suggestion would change any of the user-visible processor logic.
I think it's worth preserving our abstraction barriers. I don't actually think it would be much of a refactoring - you would keep The transformation tests would use the processor, but the full config would configure the same parser directly on the input to avoid the chunk size bug. Incidentally, I think this is kinda moot for now because all the receivers that use multiline are going to need additional changes to deal with the differences between otel and fluent-bit (I suspect by manually modifying all of the multiline regexes). So that's a further argument against adding abstraction-breaking complexity. |
|
Re @quentinmit :
Thank you for the suggestion of an alternative solution on how to test receivers with I implemented the alternative solution in #2025 following the guidelines of
Yes, i can confirm this implemented solution didn't have any user-visible changes in the processor logic. |
|
Closing in favour of #2025. |
Description
Add support for transformation testing 3P app receivers that are registered with
RegisterLoggingFilesProcessorMacro. This is required to test 3P app receivers that haveMultineRulesdefined in aLoggingReceiverFilesMixin, for example zookeeper_general.This is an improved version of #1968.
Some details :
testLoggingFilesProcessorMacroAdapterwhich "adpats" the "Macros" for a transformation test environment.logging_receiver-redistransformation test.Related issue
b/429241517
How has this been tested?
Checklist: