Skip to content

Commit edc2e56

Browse files
committed
fix
1 parent 69cb517 commit edc2e56

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

exporters/prometheus/src/main/java/io/opentelemetry/exporter/prometheus/PrometheusHttpServerBuilder.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,19 @@ public PrometheusHttpServerBuilder setPrometheusRegistry(PrometheusRegistry prom
8383
return this;
8484
}
8585

86+
/**
87+
* Set if the {@code otel_scope_*} attributes are generated. Default is {@code true}.
88+
*
89+
* @deprecated {@code otel_scope_*} attributes are always generated. Use {@link
90+
* #setOtelScopeInfoMetricEnabled(boolean)} to control emission of the {@code otel_scope_info}
91+
* metric.
92+
*/
93+
@SuppressWarnings("UnusedReturnValue")
94+
@Deprecated
95+
public PrometheusHttpServerBuilder setOtelScopeEnabled(boolean otelScopeEnabled) {
96+
return this;
97+
}
98+
8699
/** Set if the {@code otel_scope_info} metric is emitted. Default is {@code true}. */
87100
@SuppressWarnings("UnusedReturnValue")
88101
public PrometheusHttpServerBuilder setOtelScopeInfoMetricEnabled(

sdk-extensions/incubator/src/test/java/io/opentelemetry/sdk/extension/incubator/fileconfig/MetricReaderFactoryTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ void create_PullPrometheusConfigured() throws IOException {
165165
PrometheusHttpServer.builder()
166166
.setHost("localhost")
167167
.setPort(port)
168-
.setOtelScopeInfoMetricEnabled(false)
168+
.setOtelScopeInfoMetricEnabled(true) // always enabled for declarative config
169169
.setAllowedResourceAttributesFilter(
170170
IncludeExcludePredicate.createPatternMatching(
171171
singletonList("foo"), singletonList("bar")))

0 commit comments

Comments
 (0)