-
Notifications
You must be signed in to change notification settings - Fork 209
feat: create feature flag to disable default processors in Beat receivers #12334
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
base: main
Are you sure you want to change the base?
feat: create feature flag to disable default processors in Beat receivers #12334
Conversation
|
This pull request does not have a backport label. Could you fix it @andrzej-stencel? 🙏
|
|
This pull request is now in conflicts. Could you fix it? 🙏 |
864e78c to
9b642c6
Compare
💔 Build Failed
Failed CI StepsHistory
|
9b642c6 to
7976a6e
Compare
|
Pinging @elastic/elastic-agent-data-plane (Team:Elastic-Agent-Data-Plane) |
|
Pinging @elastic/elastic-agent-control-plane (Team:Elastic-Agent-Control-Plane) |
|
The global processors aren't visible in the generated otel-merged.yaml since they are implicit. That makes it's hard to tell this works without inspecting the underlying data. I would like to see a test that proves the global processors are in fact gone. If we could make them obvious in the translated config instead of implicit that would be nice and give us a way to test this without directly looking at the data or looking at logs we know come from these processors at startup. |
|
The implicit default processors are only necessary when run as part of Elastic Agent, so for the beat receivers maybe we could start injecting them as part of config translation or allow controlling them as part of receiver creation. For example the The only thing to be careful of is that the default processors need to stay in the same order in the pipeline (this affects whether processors after them can access fields they add, if they are last then this doesn't matter because nothing can access the fields and they need to stay last). |
|
Testing manually, I can see the current implementation does work, where the full set of host metadata is not attached to events, you just can't confirm that with any automated testing from what I can see. |
If my understanding is correct, there is no way for the default global processors to be defined together with other global processors, rendering the problem of ordering nonexistent. See below for my train of thought and please let me know if I'm missing something: In the current state there is no way to add global processors in Elastic Agent configuration. There is no "Processors" section in https://www.elastic.co/docs/reference/fleet/structure-config-file. Processors can be defined in the "Inputs" section, but those are input-level processors, not the global ones. This means that when translating Agent config to OTel runtime config, there are no other processors that could be put either before or after the default processors - the default processors are the only global processors that can exist in the Beat receiver configuration. If the user writes their Beat receiver config manually (bypassing Agent config translation to OTel runtime), the default processors are only added if there are no processors defined in the config, which also removes the possibility of the default processors clashing with user-defined processors. @cmacknz please let me know if my understanding is correct or I'm missing something. |
|
This pull request is now in conflicts. Could you fix it? 🙏 |
|
Let me move it to draft while working on #12493 and related changes. |
What does this PR do?
Introduces a new feature flag
default_processorswith default valuetrue. When set tofalse, the processors likeadd_host_metadatathat are by default added to Beat receivers are disabled.Why is it important?
We want to be able to disable the processors in Beat receivers so that they can be configured separately from Beat receivers. This will allow us to only use a single instance of e.g.
add_kubernetes_metadataprocessor for multiple Beat receivers.Checklist
[ ] I have made corresponding changes to the documentation[ ] I have made corresponding change to the default configuration files[ ] I have added an entry in./changelog/fragmentsusing the changelog tool[ ] I have added an integration test or an E2E testDisruptive User Impact
Unless the feature flag is explicitly configured, there is no change in behavior.
How to test this PR locally
agent::features::default_processors::enabled: falseand withagent.internal.runtime.default: otelto use the OTel runtime.hostfield, no other details. This shows that theadd_host_metadataprocessor that is included by default was disabled by the feature flag.Related issues