Polish "Use unknown_service as default application name for OpenTelemetry"
See gh-38219
This commit is contained in:
parent
470029aff1
commit
3e705e8d56
|
@ -41,7 +41,7 @@ class OtlpPropertiesConfigAdapter extends StepRegistryPropertiesConfigAdapter<Ot
|
|||
/**
|
||||
* Default value for application name if {@code spring.application.name} is not set.
|
||||
*/
|
||||
private static final String DEFAULT_APPLICATION_NAME = "application";
|
||||
private static final String DEFAULT_APPLICATION_NAME = "unknown_service";
|
||||
|
||||
private final OpenTelemetryProperties openTelemetryProperties;
|
||||
|
||||
|
|
|
@ -136,7 +136,7 @@ class OtlpPropertiesConfigAdapterTests {
|
|||
|
||||
@Test
|
||||
void shouldUseDefaultApplicationNameIfApplicationNameIsNotSet() {
|
||||
assertThat(createAdapter().resourceAttributes()).containsEntry("service.name", "application");
|
||||
assertThat(createAdapter().resourceAttributes()).containsEntry("service.name", "unknown_service");
|
||||
}
|
||||
|
||||
private OtlpPropertiesConfigAdapter createAdapter() {
|
||||
|
|
|
@ -183,7 +183,7 @@ class OpenTelemetryAutoConfigurationTests {
|
|||
exporter.await(Duration.ofSeconds(10));
|
||||
SpanData spanData = exporter.getExportedSpans().get(0);
|
||||
Map<AttributeKey<?>, Object> expectedAttributes = Resource.getDefault()
|
||||
.merge(Resource.create(Attributes.of(ResourceAttributes.SERVICE_NAME, "application")))
|
||||
.merge(Resource.create(Attributes.of(ResourceAttributes.SERVICE_NAME, "unknown_service")))
|
||||
.getAttributes()
|
||||
.asMap();
|
||||
assertThat(spanData.getResource().getAttributes().asMap()).isEqualTo(expectedAttributes);
|
||||
|
|
Loading…
Reference in New Issue