Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
Comparing source compatibility of opentelemetry-spring-boot-autoconfigure-2.13.0-SNAPSHOT.jar against opentelemetry-spring-boot-autoconfigure-2.12.0.jar
No changes.
No changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import io.opentelemetry.api.OpenTelemetry;
import io.opentelemetry.api.trace.TracerProvider;
import io.opentelemetry.instrumentation.spring.autoconfigure.internal.MapConverter;
import io.opentelemetry.instrumentation.spring.autoconfigure.internal.OTelMapConverter;
import io.opentelemetry.instrumentation.spring.autoconfigure.internal.SdkEnabled;
import io.opentelemetry.instrumentation.spring.autoconfigure.internal.properties.OtelResourceProperties;
import io.opentelemetry.instrumentation.spring.autoconfigure.internal.properties.OtelSpringProperties;
Expand Down Expand Up @@ -64,9 +64,9 @@ static class OpenTelemetrySdkConfig {

@Bean
@ConfigurationPropertiesBinding
public MapConverter mapConverter() {
public OTelMapConverter oTelMapConverter() {
// needed for otlp exporter headers and OtelResourceProperties
return new MapConverter();
return new OTelMapConverter();
}

@Bean
Expand Down Expand Up @@ -133,6 +133,16 @@ public ConfigProperties otelProperties(
@ConditionalOnProperty(name = "otel.sdk.disabled", havingValue = "true")
static class DisabledOpenTelemetrySdkConfig {

@Bean
@ConfigurationPropertiesBinding
// Duplicated in OpenTelemetrySdkConfig and DisabledOpenTelemetrySdkConfig to not expose the converter in the public API
public OTelMapConverter oTelMapConverter() {
// needed for otlp exporter headers and OtelResourceProperties
// we need this converter, even if the SDK is disabled,
// because the properties are parsed before the SDK is disabled
return new OTelMapConverter();
}

@Bean
public OpenTelemetry openTelemetry() {
return OpenTelemetry.noop();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
* <p>This class is internal and is hence not for public use. Its APIs are unstable and can change
* at any time.
*/
public class MapConverter implements Converter<String, Map<String, String>> {
public class OTelMapConverter implements Converter<String, Map<String, String>> {

public static final String KEY = "key";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,9 @@ void shouldInitializeSdkWhenNotDisabled() {
void shouldInitializeNoopOpenTelemetryWhenSdkIsDisabled() {
this.contextRunner
.withConfiguration(AutoConfigurations.of(OpenTelemetryAutoConfiguration.class))
.withPropertyValues("otel.sdk.disabled=true")
.withPropertyValues(
"otel.sdk.disabled=true",
"otel.resource.attributes=service.name=workflow-backend-dev,service.version=3c8f9ce9")
.run(
context ->
assertThat(context).getBean("openTelemetry").isEqualTo(OpenTelemetry.noop()));
Expand Down
Loading