Merging resource attributes (system variables and environment variables) #2518
Replies: 2 comments 5 replies
-
My gut tells me that this should be working already. Do you have an example of how you're setting up the resource auto-detectors that isn't working? |
Beta Was this translation helpful? Give feedback.
-
@alexvanboxel Do you mind filing an issue in the spec repo to ask what people think? We should make sure this behavior is consistent across languages. FWIW, I am inclined not to merge - almost all environment variables replace a system property setting, so merge behavior only happens for lists. I think this is inconsistent and hard to explain - environment variables always take precedence over properties is much simpler to explain / reason about. |
Beta Was this translation helpful? Give feedback.
-
In Java environment it makes sense to send some of the resource attributes through the system variables, ... and sone through
ideal to set via system properties (in docker image for example... setting name and version at build time.
service.name=my-app,service.version=1.2
ideal to set via env (example in k8s)
k8s.pod.uid=$(K8S_POD_UID),k8s.pod.name=$(K8S_POD_NAME),k8s.namespace.name=$(K8S_NAMESPACE_NAME)
last time I checked if you set one, the other is completely overridden. Looking at the above example it makes sense to merge bother the system variables and the environment variables. I think the spec doesn't say what the expected behavior is though. What's do you all think?
Beta Was this translation helpful? Give feedback.
All reactions