Skip to content

Commit

Permalink
Disable JarServiceNameDetector in unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dragosvictor committed Feb 9, 2024
1 parent 7bfda76 commit 7241867
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import io.opentelemetry.api.common.Attributes;
import io.opentelemetry.api.metrics.LongCounterBuilder;
import io.opentelemetry.api.metrics.Meter;
import io.opentelemetry.instrumentation.resources.JarServiceNameDetector;
import io.opentelemetry.sdk.autoconfigure.AutoConfiguredOpenTelemetrySdkBuilder;
import io.opentelemetry.sdk.common.InstrumentationScopeInfo;
import io.opentelemetry.sdk.metrics.export.MetricReader;
Expand Down Expand Up @@ -98,7 +99,8 @@ public void testResourceAttributesAreSet() throws Exception {
@Cleanup
var ots = OpenTelemetryService.builder().
sdkBuilderConsumer(getSdkBuilderConsumer(reader,
Map.of(OpenTelemetryService.OTEL_SDK_DISABLED_KEY, "false"))).
Map.of(OpenTelemetryService.OTEL_SDK_DISABLED_KEY, "false",
"otel.java.disabled.resource.providers", JarServiceNameDetector.class.getName()))).
clusterName("testServiceNameAndVersion").
serviceName("openTelemetryServiceTestService").
serviceVersion("1.0.0").
Expand Down

0 comments on commit 7241867

Please sign in to comment.