Skip to content

Commit 470029a

Browse files
Lenin Jaganathanmhalbritter
Lenin Jaganathan
authored andcommitted
Use unknown_service as default application name for OpenTelemetry
See gh-38219
1 parent 18f1221 commit 470029a

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/opentelemetry/OpenTelemetryAutoConfiguration.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public class OpenTelemetryAutoConfiguration {
5151
/**
5252
* Default value for application name if {@code spring.application.name} is not set.
5353
*/
54-
private static final String DEFAULT_APPLICATION_NAME = "application";
54+
private static final String DEFAULT_APPLICATION_NAME = "unknown_service";
5555

5656
private static final AttributeKey<String> ATTRIBUTE_KEY_SERVICE_NAME = AttributeKey.stringKey("service.name");
5757

spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/opentelemetry/OpenTelemetryAutoConfigurationTests.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ void shouldFallbackToDefaultApplicationNameIfSpringApplicationNameIsNotSet() {
9595
this.runner.run((context) -> {
9696
Resource resource = context.getBean(Resource.class);
9797
assertThat(resource.getAttributes().asMap())
98-
.contains(entry(ResourceAttributes.SERVICE_NAME, "application"));
98+
.contains(entry(ResourceAttributes.SERVICE_NAME, "unknown_service"));
9999
});
100100
}
101101

0 commit comments

Comments
 (0)