Skip to content

Spring boot 3.0.5 application not exporting logs to otel-collector #34921

Closed as not planned
@ff-sdesai

Description

@ff-sdesai

I had created a Spring-boot micro-service using spring-cloud-sleuth for distributed-tracing. I had a otel-collector which was receiving logs and traces from the application and it was exporting it to Datadog. The flow was working properly.

However, starting from Spring-boot 3.0.5, support of sleuth is removed and observability has been split into two parts some in Spring-boot itself and some part in micrometer. I upgraded my spring-boot version and made changes to export traces to otel-collector . But the application is not exporting the traces to otel-collector. However, if I simply add the maven dependency for Zipkin, the application tries to export traces to Zipkin and shows error since Zipkin is not running at default expected address.

I enabled the Spring debug logs and I can see that the bean for OpenTelemetryAutoConfiguration is being created. In fact, I can see all the beans defined in this class are created. I have created a small reproducer with a very few files and can be found out here. I am posting the debug logs related to this class from the application:-


OpenTelemetryAutoConfiguration matched:
      - @ConditionalOnClass found required classes 'io.micrometer.tracing.otel.bridge.OtelTracer', 'io.opentelemetry.sdk.trace.SdkTracerProvider', 'io.opentelemetry.api.OpenTelemetry' (OnClassCondition)
      - @ConditionalOnProperty (management.tracing.enabled) matched (OnPropertyCondition)

   OpenTelemetryAutoConfiguration#micrometerOtelTracer matched:
      - @ConditionalOnMissingBean (types: io.micrometer.tracing.Tracer; SearchStrategy: all) did not find any beans (OnBeanCondition)

   OpenTelemetryAutoConfiguration#openTelemetry matched:
      - @ConditionalOnMissingBean (types: io.opentelemetry.api.OpenTelemetry; SearchStrategy: all) did not find any beans (OnBeanCondition)

   OpenTelemetryAutoConfiguration#otelContextPropagators matched:
      - @ConditionalOnMissingBean (types: io.opentelemetry.context.propagation.ContextPropagators; SearchStrategy: all) did not find any beans (OnBeanCondition)

   OpenTelemetryAutoConfiguration#otelCurrentTraceContext matched:
      - @ConditionalOnMissingBean (types: io.micrometer.tracing.otel.bridge.OtelCurrentTraceContext; SearchStrategy: all) did not find any beans (OnBeanCondition)

   OpenTelemetryAutoConfiguration#otelPropagator matched:
      - @ConditionalOnMissingBean (types: io.micrometer.tracing.otel.bridge.OtelPropagator; SearchStrategy: all) did not find any beans (OnBeanCondition)

   OpenTelemetryAutoConfiguration#otelSampler matched:
      - @ConditionalOnMissingBean (types: io.opentelemetry.sdk.trace.samplers.Sampler; SearchStrategy: all) did not find any beans (OnBeanCondition)

   OpenTelemetryAutoConfiguration#otelSdkTracerProvider matched:
      - @ConditionalOnMissingBean (types: io.opentelemetry.sdk.trace.SdkTracerProvider; SearchStrategy: all) did not find any beans (OnBeanCondition)

   OpenTelemetryAutoConfiguration#otelSlf4JEventListener matched:
      - @ConditionalOnMissingBean (types: io.micrometer.tracing.otel.bridge.Slf4JEventListener; SearchStrategy: all) did not find any beans (OnBeanCondition)

   OpenTelemetryAutoConfiguration#otelSpanCustomizer matched:
      - @ConditionalOnMissingBean (types: io.micrometer.tracing.SpanCustomizer; SearchStrategy: all) did not find any beans (OnBeanCondition)

   OpenTelemetryAutoConfiguration#otelTracer matched:
      - @ConditionalOnMissingBean (types: io.opentelemetry.api.trace.Tracer; SearchStrategy: all) did not find any beans (OnBeanCondition)

   OpenTelemetryAutoConfiguration#otelTracerEventPublisher matched:
      - @ConditionalOnMissingBean (types: io.micrometer.tracing.otel.bridge.OtelTracer$EventPublisher; SearchStrategy: all) did not find any beans (OnBeanCondition)

   OpenTelemetryAutoConfiguration.BaggageConfiguration matched:
      - @ConditionalOnProperty (management.tracing.baggage.enabled) matched (OnPropertyCondition)

   OpenTelemetryAutoConfiguration.BaggageConfiguration#otelSlf4JBaggageEventListener matched:
      - @ConditionalOnProperty (management.tracing.baggage.correlation.enabled) matched (OnPropertyCondition)
      - @ConditionalOnMissingBean (types: io.micrometer.tracing.otel.bridge.Slf4JBaggageEventListener; SearchStrategy: all) did not find any beans (OnBeanCondition)

   OpenTelemetryAutoConfiguration.BaggageConfiguration#w3cTextMapPropagatorWithBaggage matched:
      - @ConditionalOnProperty (management.tracing.propagation.type=W3C) matched (OnPropertyCondition)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions