From 991e8f2b71d68937c71bfdf554e18f296cd6e6d6 Mon Sep 17 00:00:00 2001 From: Mateusz Rzeszutek Date: Tue, 13 Sep 2022 13:15:02 +0200 Subject: [PATCH] add comment --- .../spring/resources/SpringBootServiceNameGuesser.java | 2 ++ 1 file changed, 2 insertions(+) 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