Skip to content

Conversation

@franciscovalentecastro
Copy link
Contributor

@franciscovalentecastro franciscovalentecastro commented Aug 8, 2025

Description

This PR creates the interface InternalLoggingProcessorMerger to enable InternalLoggingReceivers to merge InternalLoggingProcessors features into the receiver when possible and supported.

Specifically the new method MergeInternalLoggingProcessor of LoggingReceiverFilesMixin will merge the processor LoggingProcessorParseMultilineRegex.Rules []MultilineRules into the files receiver.

Details

  • Co-author @quentinmit : All the related MULTILINE_PARSER logic was updated so the "merging" only has to be implemented in one place. This reduces a lot of tech debt.

  • This solution resembles the already implemented MetricsProcessorMerger. This solution differs in the abstraction layer where this "merges" happen. MetricsProcessorMerger works for a processor in an Ops Agent pipeline. In comparison, InternalLoggingProcessorMerger works for a processor within a LoggingReceiver definition.

Updates

  • Created InternalLoggingProcessorMerger with method MergeInternalLoggingProcessor.
  • Added MergeInternalLoggingProcessor method to LoggingReceiverFilesMixin.
    • This will merge LoggingProcessorParseMultilineRegex.Rules []MultilineRules into the files receiver when possible.
  • Updated elasticseach_json receiver and processor with this refactoring.
    • Transformation test with multiline processing work as expected.

Context

As described before in #2013, there are fluent-bit downsides/bugs related to having MultilineRules in a separate FILTER processor outside of the INPUT. This solution enables the processor to merge this MultilineRules to the INPUT receiver when possible to avoid the downsides/bugs.

Related issue

b/413410475

How has this been tested?

Checklist:

  • Unit tests
    • Unit tests do not apply.
    • Unit tests have been added/modified and passed for this PR.
  • Integration tests
    • Integration tests do not apply.
    • Integration tests have been added/modified and passed for this PR.
  • Documentation
    • This PR introduces no user visible changes.
    • This PR introduces user visible changes and the corresponding documentation change has been made.
  • Minor version bump
    • This PR introduces no new features.
    • This PR introduces new features, and there is a separate PR to bump the minor version since the last release already.
    • This PR bumps the version.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I take it you're adding this so you can register only the receiver. If we correctly handle the merging, though, can't we just continue to register it as a receiver + processor?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did this because all of this 3P app receivers that have MultilineRules in the INPUT tail receiver don't register a processor. Arguably, after this change, there is no restriction anymore since the processor now could work as a standalone without the multiline parsing in the INPUT.

@franciscovalentecastro franciscovalentecastro force-pushed the fcovalente-processor-merger branch from 28e4dca to a2aef14 Compare August 12, 2025 15:05
@franciscovalentecastro franciscovalentecastro force-pushed the fcovalente-processor-merger branch from ff85480 to ddb2b27 Compare August 12, 2025 19:33
Copy link
Contributor Author

@franciscovalentecastro franciscovalentecastro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

There are some test failures (e.g. missing update goldens) which may be solved after removing some debug statements.

Thank you for all the help in this PR @quentinmit !

`yamlTag == "-"` doesn't work because the golden test contains its own
copy of the code (!), so the change was a noop.
Now that we correctly merge multiline rules into inputs, it can safely
be used as the first processor in a file pipeline.
@quentinmit
Copy link
Member

Unfortunately we were still getting fluent-bit segfaults on some of the transformation tests. I think I might have finally fixed them (by removing the empty multiline filter we were generating after moving the rules into the input), so if the checks all pass tonight I'll merge this. Otherwise we need to do more segfault hunting tomorrow.

@quentinmit
Copy link
Member

The four remaining test failures all appear to be unrelated flakes due to quota issues in our CI environment, so I'm going to merge this.

@quentinmit quentinmit merged commit f5ef95d into master Aug 15, 2025
58 of 62 checks passed
@quentinmit quentinmit deleted the fcovalente-processor-merger branch August 15, 2025 20: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.

3 participants