Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disabling OTEL SDK causes autoconfiguration to fail due to missing ConfigProperties #10600

Closed
pmitura-lucid opened this issue Feb 19, 2024 · 1 comment · Fixed by #10602
Closed
Assignees
Labels
bug Something isn't working

Comments

@pmitura-lucid
Copy link

pmitura-lucid commented Feb 19, 2024

Describe the bug

With Spring Boot starter, setting otel.sdk.disabled = true causes the application startup to fail on on a missing ConfigProperties bean dependency. This can be triggered by any of the four autoconfiguration classes that now depend on config properties:

OtlpSpanExporterAutoConfiguration
OtlpLogRecordExporterAutoConfiguration
OtlpMetricExporterAutoConfiguration
PropagationAutoConfiguration

The issue does not happen in 2.0.0-alpha, the likely change that triggered it is f715a18, and d8aa0f5 for propagation.

Steps to reproduce

otel:
  sdk:
    disabled: true
  • Run the application

Expected behavior

The application starts up, with SDK entirely disabled.

Actual behavior

The application startup fails with:

org.springframework.beans.factory.UnsatisfiedDependencyException:
Error creating bean with name 'otelOtlpLogRecordExporter' defined in class path resource [io/opentelemetry/instrumentation/spring/autoconfigure/exporters/otlp/OtlpLogRecordExporterAutoConfiguration.class]:
Unsatisfied dependency expressed through method 'otelOtlpLogRecordExporter' parameter 0:
No qualifying bean of type 'io.opentelemetry.sdk.autoconfigure.spi.ConfigProperties' available:
expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {}

The specific exporter may vary, this is one of 4 possible unsatisfied dependencies.

Javaagent or library instrumentation version

2.1.0-alpha

Environment

JDK: Corretto 21
OS: Mac OS Ventura
Spring Boot 3.2.2

Additional context

As a possible workaround, the application starts up if all exporters and propagation is explicitly disabled:

otel:
  sdk:
    disabled: true
  traces:
    exporter: none
  logs:
    exporter: none
  metrics:
    exporter: none
  propagation:
    enabled: false
@pmitura-lucid pmitura-lucid added bug Something isn't working needs triage New issue that requires triage labels Feb 19, 2024
@laurit
Copy link
Contributor

laurit commented Feb 19, 2024

@zeitlinger could you take a look

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
3 participants