From e2b66fd367a988cff0f9c528904f2d6f0fca2a95 Mon Sep 17 00:00:00 2001 From: brunobat Date: Wed, 30 Apr 2025 12:07:05 +0100 Subject: [PATCH 1/2] Allow frameworks to add instrumentation scope conditions --- .../io/opentelemetry/sdk/logs/SdkLoggerProviderBuilder.java | 2 +- .../io/opentelemetry/sdk/metrics/SdkMeterProviderBuilder.java | 2 +- .../io/opentelemetry/sdk/trace/SdkTracerProviderBuilder.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sdk/logs/src/main/java/io/opentelemetry/sdk/logs/SdkLoggerProviderBuilder.java b/sdk/logs/src/main/java/io/opentelemetry/sdk/logs/SdkLoggerProviderBuilder.java index 67c7d8477f2..9d5f511df03 100644 --- a/sdk/logs/src/main/java/io/opentelemetry/sdk/logs/SdkLoggerProviderBuilder.java +++ b/sdk/logs/src/main/java/io/opentelemetry/sdk/logs/SdkLoggerProviderBuilder.java @@ -161,7 +161,7 @@ SdkLoggerProviderBuilder setLoggerConfigurator( * @see ScopeConfiguratorBuilder#nameEquals(String) * @see ScopeConfiguratorBuilder#nameMatchesGlob(String) */ - SdkLoggerProviderBuilder addLoggerConfiguratorCondition( + public SdkLoggerProviderBuilder addLoggerConfiguratorCondition( Predicate scopeMatcher, LoggerConfig loggerConfig) { this.loggerConfiguratorBuilder.addCondition(scopeMatcher, loggerConfig); return this; diff --git a/sdk/metrics/src/main/java/io/opentelemetry/sdk/metrics/SdkMeterProviderBuilder.java b/sdk/metrics/src/main/java/io/opentelemetry/sdk/metrics/SdkMeterProviderBuilder.java index 90d0c7a8fef..879e447a3b6 100644 --- a/sdk/metrics/src/main/java/io/opentelemetry/sdk/metrics/SdkMeterProviderBuilder.java +++ b/sdk/metrics/src/main/java/io/opentelemetry/sdk/metrics/SdkMeterProviderBuilder.java @@ -192,7 +192,7 @@ SdkMeterProviderBuilder setMeterConfigurator(ScopeConfigurator mete * @see ScopeConfiguratorBuilder#nameEquals(String) * @see ScopeConfiguratorBuilder#nameMatchesGlob(String) */ - SdkMeterProviderBuilder addMeterConfiguratorCondition( + public SdkMeterProviderBuilder addMeterConfiguratorCondition( Predicate scopeMatcher, MeterConfig meterConfig) { this.meterConfiguratorBuilder.addCondition(scopeMatcher, meterConfig); return this; diff --git a/sdk/trace/src/main/java/io/opentelemetry/sdk/trace/SdkTracerProviderBuilder.java b/sdk/trace/src/main/java/io/opentelemetry/sdk/trace/SdkTracerProviderBuilder.java index fa42a99876e..f9adc3176af 100644 --- a/sdk/trace/src/main/java/io/opentelemetry/sdk/trace/SdkTracerProviderBuilder.java +++ b/sdk/trace/src/main/java/io/opentelemetry/sdk/trace/SdkTracerProviderBuilder.java @@ -207,7 +207,7 @@ SdkTracerProviderBuilder setTracerConfigurator( * @see ScopeConfiguratorBuilder#nameEquals(String) * @see ScopeConfiguratorBuilder#nameMatchesGlob(String) */ - SdkTracerProviderBuilder addTracerConfiguratorCondition( + public SdkTracerProviderBuilder addTracerConfiguratorCondition( Predicate scopeMatcher, TracerConfig tracerConfig) { this.tracerConfiguratorBuilder.addCondition(scopeMatcher, tracerConfig); return this; From 87c2ba0e2086246c11ca1b9d181445e2c7b07b3d Mon Sep 17 00:00:00 2001 From: brunobat Date: Wed, 30 Apr 2025 15:31:29 +0100 Subject: [PATCH 2/2] Code changes generation --- docs/apidiffs/current_vs_latest/opentelemetry-sdk-logs.txt | 1 + docs/apidiffs/current_vs_latest/opentelemetry-sdk-metrics.txt | 3 +++ docs/apidiffs/current_vs_latest/opentelemetry-sdk-trace.txt | 1 + 3 files changed, 5 insertions(+) diff --git a/docs/apidiffs/current_vs_latest/opentelemetry-sdk-logs.txt b/docs/apidiffs/current_vs_latest/opentelemetry-sdk-logs.txt index 77f779d1926..93aa5db2174 100644 --- a/docs/apidiffs/current_vs_latest/opentelemetry-sdk-logs.txt +++ b/docs/apidiffs/current_vs_latest/opentelemetry-sdk-logs.txt @@ -9,4 +9,5 @@ Comparing source compatibility of opentelemetry-sdk-logs-1.50.0-SNAPSHOT.jar aga +++ NEW ANNOTATION: javax.annotation.Nullable *** MODIFIED CLASS: PUBLIC FINAL io.opentelemetry.sdk.logs.SdkLoggerProviderBuilder (not serializable) === CLASS FILE FORMAT VERSION: 52.0 <- 52.0 + *** MODIFIED METHOD: PUBLIC (<- PACKAGE_PROTECTED) io.opentelemetry.sdk.logs.SdkLoggerProviderBuilder addLoggerConfiguratorCondition(java.util.function.Predicate, io.opentelemetry.sdk.logs.internal.LoggerConfig) +++ NEW METHOD: PUBLIC(+) io.opentelemetry.sdk.logs.SdkLoggerProviderBuilder addLogRecordProcessorFirst(io.opentelemetry.sdk.logs.LogRecordProcessor) diff --git a/docs/apidiffs/current_vs_latest/opentelemetry-sdk-metrics.txt b/docs/apidiffs/current_vs_latest/opentelemetry-sdk-metrics.txt index 72a131718a9..996fdf483ff 100644 --- a/docs/apidiffs/current_vs_latest/opentelemetry-sdk-metrics.txt +++ b/docs/apidiffs/current_vs_latest/opentelemetry-sdk-metrics.txt @@ -59,3 +59,6 @@ Comparing source compatibility of opentelemetry-sdk-metrics-1.50.0-SNAPSHOT.jar *** MODIFIED INTERFACE: PUBLIC ABSTRACT io.opentelemetry.sdk.metrics.data.ValueAtQuantile (not serializable) === CLASS FILE FORMAT VERSION: 52.0 <- 52.0 +++ NEW METHOD: PUBLIC(+) STATIC(+) io.opentelemetry.sdk.metrics.data.ValueAtQuantile create(double, double) +*** MODIFIED CLASS: PUBLIC FINAL io.opentelemetry.sdk.metrics.SdkMeterProviderBuilder (not serializable) + === CLASS FILE FORMAT VERSION: 52.0 <- 52.0 + *** MODIFIED METHOD: PUBLIC (<- PACKAGE_PROTECTED) io.opentelemetry.sdk.metrics.SdkMeterProviderBuilder addMeterConfiguratorCondition(java.util.function.Predicate, io.opentelemetry.sdk.metrics.internal.MeterConfig) diff --git a/docs/apidiffs/current_vs_latest/opentelemetry-sdk-trace.txt b/docs/apidiffs/current_vs_latest/opentelemetry-sdk-trace.txt index 9a3b5305423..44f89d32898 100644 --- a/docs/apidiffs/current_vs_latest/opentelemetry-sdk-trace.txt +++ b/docs/apidiffs/current_vs_latest/opentelemetry-sdk-trace.txt @@ -2,3 +2,4 @@ Comparing source compatibility of opentelemetry-sdk-trace-1.50.0-SNAPSHOT.jar ag *** MODIFIED CLASS: PUBLIC FINAL io.opentelemetry.sdk.trace.SdkTracerProviderBuilder (not serializable) === CLASS FILE FORMAT VERSION: 52.0 <- 52.0 +++ NEW METHOD: PUBLIC(+) io.opentelemetry.sdk.trace.SdkTracerProviderBuilder addSpanProcessorFirst(io.opentelemetry.sdk.trace.SpanProcessor) + *** MODIFIED METHOD: PUBLIC (<- PACKAGE_PROTECTED) io.opentelemetry.sdk.trace.SdkTracerProviderBuilder addTracerConfiguratorCondition(java.util.function.Predicate, io.opentelemetry.sdk.trace.internal.TracerConfig)