Skip to content

Conversation

mx-psi
Copy link
Member

@mx-psi mx-psi commented Oct 10, 2025

Description

Adds support for disabling or enabling optional fields through an enabled key under an alpha feature gate, configoptional.AddEnabledField. For example, the following configuration becomes valid:

receivers:
  otlp:
    protocols:
      grpc:
        enabled: true

exporters:
  nop:

service:
  pipelines:
    traces:
      receivers: [otlp]
      exporters: [nop]

and is equivalent to:

receivers:
  otlp:
    protocols:
      grpc:

exporters:
  nop:

service:
  pipelines:
    traces:
      receivers: [otlp]
      exporters: [nop]

Link to tracking issue

Fixes #13894
Updates #14021

Copy link

codecov bot commented Oct 10, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.65%. Comparing base (ccc1302) to head (69f76b5).

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #13995   +/-   ##
=======================================
  Coverage   91.65%   91.65%           
=======================================
  Files         654      654           
  Lines       42659    42671   +12     
=======================================
+ Hits        39100    39112   +12     
  Misses       2744     2744           
  Partials      815      815           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Member

@lahsivjar lahsivjar left a comment

Choose a reason for hiding this comment

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

Nice! LGTM!

@mx-psi mx-psi marked this pull request as ready for review October 14, 2025 15:49
@mx-psi mx-psi requested a review from a team as a code owner October 14, 2025 15:49
@mx-psi mx-psi requested a review from TylerHelmuth October 14, 2025 15:49
@mx-psi mx-psi changed the title [configoptional] Add support for setting an 'enabled' field [configoptional] Add support for setting an 'enabled' field under a feature gate Oct 14, 2025
Copy link
Contributor

@jade-guiton-dd jade-guiton-dd left a comment

Choose a reason for hiding this comment

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

Looks mostly good to me, although I think we'll want community feedback from end user and component author perspectives. Additionally, while I'm ambivalent about enabled vs. disabled, others may have strong opinions.

change_type: enhancement

# The name of the component, or a single word describing the area of concern, (e.g. otlpreceiver)
component: config/configoptional
Copy link
Contributor

Choose a reason for hiding this comment

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

This should be 'all' to pass the component list test (see this thread)

addEnabledFieldFeatureGateID,
featuregate.StageAlpha,
featuregate.WithRegisterFromVersion("v0.138.0"),
featuregate.WithRegisterDescription("Allows optional fields to be configured via an 'enabled' field."),
Copy link
Contributor

Choose a reason for hiding this comment

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

Nitpick: s/configured/toggled/ may be clearer?

component: config/configoptional

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Adds new `configoptional.AddEnabledField` feature gate that allows user to decide `configoptional` flavor through a new `enabled` field
Copy link
Contributor

Choose a reason for hiding this comment

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

Nitpick: "Flavor" is more of an internal term, maybe "allows users to explicitly disable a configoptional.Optional through a new enabled field"?

Copy link
Contributor

@jmacd jmacd left a comment

Choose a reason for hiding this comment

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

Nice!

Copy link
Member

@songy23 songy23 left a comment

Choose a reason for hiding this comment

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

👍

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.

[exporterhelper] Enable batching by default in a component

6 participants