-
Notifications
You must be signed in to change notification settings - Fork 791
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
OTEL_RESOURCE_ATTRIBUTES is ignored when using OTEL_RESOURCE_ATTRIBUTES_* (e.g. OTEL_RESOURCE_ATTRIBUTES_POD_NAME) #10959
Comments
Hey @Synthenses thanks for the report. A couple of questions:
|
oh, right, I believe this feature was removed in #10453, when we consolidated the spring boot starter to use the standard autoconfigure module configuration, looks like we missed that in the release notes |
|
We're using spring logic to read the resource attributes - so one could argue that it's a spring boot bug. In the end, I think spring decides to give priority to the map - but this is not an acceptable solution for us - because our contract is that the env var will always be honored - so I'll fix this on our side. |
Describe the bug
When OTEL_RESOURCE_ATTRIBUTES envierment variable is ignored when OTEL_RESOURCE_ATTRIBUTES_* (e.g. OTEL_RESOURCE_ATTRIBUTES_POD_NAME) is also defind
Steps to reproduce
Default spring boot project with opentelemetry-spring-boot-starter v2.2.0-alpha and following the configuration in the application.properties
otel.resource.attributes=environment=dev,xyz=foo
otel.resource.attributes.pod.name=TestPod
Define a Env Variable Like OTEL_RESOURCE_ATTRIBUTES_POD_NAME=TestPod and OTEL_RESOURCE_ATTRIBUTES=env=dev,xyz=foo
REPO
Here you can see in the console log that only TestPod is contained in the Json, if you remove this from the application.properties you can find dev and foo in the log
Expected behavior
log collected by opentelemetry should contain the resource attributes set via OTEL_RESOURCE_ATTRIBUTES envierment variable
Actual behavior
log collected by opentelemetry does not contain the resource attributes set via OTEL_RESOURCE_ATTRIBUTES envierment variable, only the resource attribute pod.name=TestPod
Javaagent or library instrumentation version
opentelemetry-spring-boot-starter v2.2.0-alpha
Environment
JDK: Temurin-17.0.9+9
OS: Windows 10
Spring Boot: 3.2.4
Additional context
Found Bug by deploying an application with spirng starter boot starter to kubernetes, which is injected via inject sdk which generating env variabl OTEL_RESOURCES_ATTRIBUTES
The text was updated successfully, but these errors were encountered: