diff --git a/instrumentation/spring/spring-boot-resources/library/src/main/java/io/opentelemetry/instrumentation/spring/resources/SpringBootServiceNameGuesser.java b/instrumentation/spring/spring-boot-resources/library/src/main/java/io/opentelemetry/instrumentation/spring/resources/SpringBootServiceNameGuesser.java index d5f56825ed48..47f09dc6dcca 100644 --- a/instrumentation/spring/spring-boot-resources/library/src/main/java/io/opentelemetry/instrumentation/spring/resources/SpringBootServiceNameGuesser.java +++ b/instrumentation/spring/spring-boot-resources/library/src/main/java/io/opentelemetry/instrumentation/spring/resources/SpringBootServiceNameGuesser.java @@ -98,6 +98,8 @@ public Resource createResource(ConfigProperties config) { @Override public boolean shouldApply(ConfigProperties config, Resource resource) { + // we're skipping this provider if the service name was manually set by the user -- no need to + // waste time trying to compute the service name if it's going to be overriden anyway String serviceName = config.getString("otel.service.name"); Map resourceAttributes = config.getMap("otel.resource.attributes"); return serviceName == null