-
Notifications
You must be signed in to change notification settings - Fork 1k
Description
Describe the bug
Using spring boot starter v2.0.0, which introduced an improvement for using the OTEL_EXPORTER_OTLP_HEADERS property, I get the following error message.
APPLICATION FAILED TO START
Description:
Failed to bind properties under 'otel.exporter.otlp.headers' to java.util.Map<java.lang.String, java.lang.String>:
Property: otel.exporter.otlp.headers
Value: "api-key=12345"
Origin: System Environment Property "OTEL_EXPORTER_OTLP_HEADERS"
Reason: org.springframework.core.convert.ConverterNotFoundException: No converter found capable of converting from type [java.lang.String] to type [java.util.Map<java.lang.String, java.lang.String>]
Action:
Update your application's configuration
Steps to reproduce
- Add
opentelemetry-spring-boot-starterto Maven dependency (v2.0.0) in app - Set the following environment variables
- OTEL_EXPORTER_OTLP_HEADERS=api-key=123
- Run the app and see error message
Expected behavior
Setting the environment variable as described by the documentation would result in an api-key property being added to the headers Map for the OTLP exporter.
Actual behavior
Application fails to start with a ConverterNotFoundException
Javaagent or library instrumentation version
2.0.0_alpha
Environment
Spring Boot 3.2.1, Java 17
Additional context
When setting the headers via application.properties (e.g. otel.exporter.otlp.headers.api-key=12345), the application works as intended. It is only when trying to set via environment variables that the header is not respected or read.