Skip to content

Fix inverted scope_info_enabled and target_info_enabled declarative config flags - #8750

Open
thswlsqls wants to merge 1 commit into
open-telemetry:mainfrom
thswlsqls:fix/prometheus-declarative-config-inverted-info-flags
Open

Fix inverted scope_info_enabled and target_info_enabled declarative config flags#8750
thswlsqls wants to merge 1 commit into
open-telemetry:mainfrom
thswlsqls:fix/prometheus-declarative-config-inverted-info-flags

Conversation

@thswlsqls

Copy link
Copy Markdown
Contributor

Fixes #8749

Description

  • PrometheusComponentProvider.create() passed !value to setOtelScopeLabelsEnabled and setTargetInfoMetricEnabled, so both declarative config options did the opposite of what they say.
  • The negation is left over from Update to opentelemetry-configuration v1.1.0 #8451, which renamed the keys from without_scope_info / without_target_info to the positive form but kept the !.
  • The opentelemetry-configuration schema and the generated ExperimentalPrometheusMetricExporterModel javadoc define both keys as "if omitted or null, true is used".
  • Local variables renamed to match the keys.

Testing done

  • MetricReaderFactoryTest's "pull prometheus configured" case feeds false for both keys but expected the builder defaults (true), so it only passed while the bug existed. The corrected expectation fails before this change and passes after.
  • That test lives in :sdk-extensions:declarative-config because that is where ComponentProvider coverage sits; :exporters:prometheus has :api:incubator only as compileOnly.
  • ./gradlew :exporters:prometheus:check (202 tests) and :sdk-extensions:declarative-config:check (514 tests) pass.
  • No apidiff update: alpha artifact, internal package, no file under docs/apidiffs/current_vs_latest/.

@codecov

codecov Bot commented Aug 27, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.28%. Comparing base (e2efec5) to head (fabb098).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #8750      +/-   ##
============================================
- Coverage     91.29%   91.28%   -0.01%     
+ Complexity    10498    10495       -3     
============================================
  Files          1006     1006              
  Lines         28338    28338              
  Branches       3581     3579       -2     
============================================
- Hits          25870    25869       -1     
  Misses         1675     1675              
- Partials        793      794       +1     

☔ View full report in Codecov by Harness.
📢 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.

@thswlsqls
thswlsqls marked this pull request as ready for review September 2, 2026 04:04
@thswlsqls
thswlsqls requested a review from a team as a code owner September 2, 2026 04:04
@opentelemetry-pr-dashboard

opentelemetry-pr-dashboard Bot commented Sep 2, 2026

Copy link
Copy Markdown

Pull request dashboard status

Waiting on reviewers · refreshed 2026-09-02 14:35 UTC

Review the latest changes.

Status above doesn't look right?
  • Just replied or pushed? Anything around or after the refresh time above may not be picked up yet — give it a few minutes.
  • Anything look wrong? Report it with what you expected; it helps us improve the dashboard.

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.

Prometheus declarative config inverts scope_info_enabled and target_info_enabled

1 participant