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

Add feature flags for running beats as OTel receivers #6486

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

andrzej-stencel
Copy link
Contributor

What does this PR do?

Adds new Agent feature flag "beats_as_otel_receivers". This is for internal usage only. No documentation or changelog is added for this.

Checklist

  • I have read and understood the pull request guidelines of this project.
  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • [ ] I have made corresponding changes to the documentation
  • [ ] I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works
  • [ ] I have added an entry in ./changelog/fragments using the changelog tool
  • [ ] I have added an integration test or an E2E test

This is for internal usage only.
No documentation or changelog is added for this.
@andrzej-stencel andrzej-stencel added Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team skip-changelog backport-8.x Automated backport to the 8.x branch with mergify labels Jan 7, 2025
@andrzej-stencel andrzej-stencel requested a review from a team as a code owner January 7, 2025 13:29
@elasticmachine
Copy link
Contributor

Pinging @elastic/elastic-agent-control-plane (Team:Elastic-Agent-Control-Plane)

Copy link
Contributor

@blakerouse blakerouse left a comment

Choose a reason for hiding this comment

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

I worry that this feature flag is too broad. We might want to define a few flags to enable this. We want to start with monitoring only so maybe monitoring_as_beatsreceivers would be better. I see beats_as_otel_receivers as meaning that all beat inputs are converted to otel beatsreceivers. I do think we want to get to that level, but we might want to do it in stages. A user might just want to turn on monitoring for now, test it out then turn it on the others once we support those as well. I think if we don't add some levels of enablement here, it because an all on or nothing and that is probably not something we would want.

I was leaning this more to a flag in the monitoring configuration so it just turned on specifically to monitoring.

@andrzej-stencel
Copy link
Contributor Author

I worry that this feature flag is too broad. We might want to define a few flags to enable this. We want to start with monitoring only so maybe monitoring_as_beatsreceivers would be better. I see beats_as_otel_receivers as meaning that all beat inputs are converted to otel beatsreceivers. I do think we want to get to that level, but we might want to do it in stages. A user might just want to turn on monitoring for now, test it out then turn it on the others once we support those as well. I think if we don't add some levels of enablement here, it because an all on or nothing and that is probably not something we would want.

I was leaning this more to a flag in the monitoring configuration so it just turned on specifically to monitoring.

I agree we might want separate feature flags for monitoring and for data collection. Given that this feature flag is not documented, I believe we can always change, rename, delete, add new flags later, right?

I think it would be best to add a specific feature flag together with the functionality it implements, as a single task. A separate task for just creating a feature flag in isolation from the functionality it guards is prone to deliberations like this.

I propose to close this task and add new feature flag(s) as part of one or both of the tasks:

Alternatively, I can create two separate feature flags for monitoring and data collection as part of this task. As I said, we can always modify the approach later.

@andrzej-stencel
Copy link
Contributor Author

andrzej-stencel commented Jan 9, 2025

I've added another feature flag "monitoring_with_otel" in 56ee320. Let me know what you think about the naming.

@andrzej-stencel andrzej-stencel changed the title Add feature flag "beats_as_otel_receivers" Add feature flags for running beats as OTel receivers Jan 9, 2025
beatsAsOtelReceivers bool

// monitoringWithOtel indicates if the Agent should use OpenTelemetry components for self-monitoring instead of Beats.
monitoringWithOtel bool
Copy link
Contributor

Choose a reason for hiding this comment

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

I think there is a case where we want to run monitoring with native otel in the future. So we might just want to use a little different name. What about monitoringWithOtelReceivers? Just so in the future we want to add monitoringWithOtel where it is using native filelog receiver and a native metric receiver.

@@ -37,6 +41,12 @@ type Flags struct {
fqdnCallbacks map[string]BoolValueOnChangeCallback

tamperProtection bool

// beatsAsOtelReceivers indicates if the Agent run Beats as OpenTelemetry receivers like filebeatreceiver etc.
beatsAsOtelReceivers bool
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think this should just be a boolean. I think this needs to be an array of input types to run as otel beatsreceivers. That way the feature can be enable per input type at a time for the user. They will want to test out 1 input, see if it works then enable the next type. They will not want to be a change all. Possible that a * can be used to mean all of them, but I think we need a way to limit it to specific input types.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-8.x Automated backport to the 8.x branch with mergify skip-changelog Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants