Describe the bug
PrometheusComponentProvider.create() negates the declarative config values for scope_info_enabled and target_info_enabled/development, so both options do the opposite of what they say.
Steps to reproduce
Declarative config file:
meter_provider:
readers:
- pull:
exporter:
prometheus/development:
scope_info_enabled: false
target_info_enabled/development: false
What did you expect to see?
Scope labels and the target_info metric disabled. The opentelemetry-configuration schema defines both keys as "if omitted or null, true is used", so an explicit true must enable and an explicit false must disable. The generated ExperimentalPrometheusMetricExporterModel javadoc says the same.
What did you see instead?
Both stay enabled. PrometheusComponentProvider.create() (exporters/prometheus/src/main/java/io/opentelemetry/exporter/prometheus/internal/PrometheusComponentProvider.java lines 50-57) applies ! to both values. #8451 renamed the keys from without_scope_info / without_target_info to the positive form but left the negation in place, so the meaning flipped.
What version and what artifacts are you using?
Artifacts: opentelemetry-exporter-prometheus, opentelemetry-sdk-extension-declarative-config
Version: main @ 3a9fdc6 (1.66.0-SNAPSHOT)
How did you reference these artifacts? Built from source.
Environment
Compiler: Temurin 21
OS: N/A
Additional context
MetricReaderFactoryTest's "pull prometheus configured" case passes false for both keys but its expected reader leaves them at the builder default true, so the test only passes while the bug exists.
Describe the bug
PrometheusComponentProvider.create()negates the declarative config values forscope_info_enabledandtarget_info_enabled/development, so both options do the opposite of what they say.Steps to reproduce
Declarative config file:
What did you expect to see?
Scope labels and the
target_infometric disabled. Theopentelemetry-configurationschema defines both keys as "if omitted or null, true is used", so an explicittruemust enable and an explicitfalsemust disable. The generatedExperimentalPrometheusMetricExporterModeljavadoc says the same.What did you see instead?
Both stay enabled.
PrometheusComponentProvider.create()(exporters/prometheus/src/main/java/io/opentelemetry/exporter/prometheus/internal/PrometheusComponentProvider.javalines 50-57) applies!to both values. #8451 renamed the keys fromwithout_scope_info/without_target_infoto the positive form but left the negation in place, so the meaning flipped.What version and what artifacts are you using?
Artifacts: opentelemetry-exporter-prometheus, opentelemetry-sdk-extension-declarative-config
Version: main @ 3a9fdc6 (1.66.0-SNAPSHOT)
How did you reference these artifacts? Built from source.
Environment
Compiler: Temurin 21
OS: N/A
Additional context
MetricReaderFactoryTest's "pull prometheus configured" case passesfalsefor both keys but its expected reader leaves them at the builder defaulttrue, so the test only passes while the bug exists.