Propagate all feature flags to Beat receivers#15458
Conversation
Assisted-by: GPT-5.6 Sol
|
This pull request does not have a backport label. Could you fix it @belimawr? 🙏
|
There was a problem hiding this comment.
Pull request overview
This PR makes Beat receiver configuration generation in the OTel translator propagate the full agent.features subtree (from component feature metadata) instead of special-casing only fqdn. This aligns Beat receivers with the Agent policy’s feature flags and enables forward-compatible propagation of future Beat-supported flags without translator changes.
Changes:
- Preserve the raw
agent.featuressubtree inproto.Features.Sourceduring feature parsing (instead of deriving Source from typed fields only). - Update the OTel translator to populate Beat receiver
features.*from the component’s feature Source metadata and remove the separate FQDN-only injection path. - Add/adjust tests to cover multiple propagated flags, explicit
false, unknown future flags, and absence of feature metadata.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/features/features.go | Reworks feature Source generation to preserve the raw agent.features subtree for downstream consumers. |
| pkg/features/features_test.go | Adds coverage to ensure Parse preserves the agent.features subtree (including unknown flags). |
| internal/pkg/otel/translate/otelconfig.go | Removes FQDN-only propagation and derives Beat receiver features from component feature Source metadata. |
| internal/pkg/otel/translate/otelconfig_test.go | Updates expectations and adds tests ensuring multiple flags propagate and missing feature metadata omits features. |
| changelog/fragments/1783638976-propagate-all-feature-flags-to-beat-receivers.yaml | Adds a changelog fragment documenting the bug fix. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
TL;DRThis build has two independent, deterministic failures. Remediation
Investigation detailsRoot Cause
|
…ass-all-beat-features-f821
💚 Build Succeeded
History
cc @belimawr |
What does this PR do?
Preserves the original
agent.featuressubtree in component feature metadata and copies it into generated Beat receiver configs. Removes the separate global FQDN-only propagation path so feature source metadata is authoritative and future Beat-supported flags propagate without translator changes.Adds coverage for FQDN,
log_input_run_as_filestream,aws_s3_v2, unknown future flags, explicit false values, and missing feature metadata.Why is it important?
The OTel translator previously propagated only FQDN. Other Beat-supported feature flags were dropped, causing Beat receivers to behave differently from the Agent policy.
Checklist
[ ] I have made corresponding changes to the documentation[ ] I have made corresponding change to the default configuration files./changelog/fragmentsusing the changelog tool[ ] I have added an integration test or an E2E testDocumentation, default configuration, and new integration coverage are not required; this fixes internal propagation and existing receiver integration coverage exercises these flags.
Disruptive User Impact
None. Configured feature flags now consistently reach OTel Beat receivers.
How to test this PR locally
Run the tests
Manual test
1. Build and unpack a development Agent package
From the repository root:
2. Create a test log and
elastic-agent.ymlThe policy deliberately configures a legacy
loginput, forces it to run as a Beat receiver, and enablesagent.features.log_input_run_as_filestream.elastic-agent.yml
3. Start Elastic Agent in standalone mode
Connection errors for
127.0.0.1:9200are expected when Elasticsearch is not running and do not affect this test.4. Verify that the
loginput started as FilestreamIn another terminal:
The output should contain a Filebeat receiver log similar to:
The standalone policy still declares
type: log; seeinginput.filestreamandInput 'filestream' startingconfirms thatagent.features.log_input_run_as_filestream.enabled: truereached the generated Beat receiver and was applied. Stop the Agent with Ctrl-C after the assertion succeeds.Related issues
agent.features.*flags to Beat receivers #15437