Dynamic (Resource) ServiceName #5691
-
Hi! I'm exporting traces from my application and it's registered like:
...which makes the traces that end up in the trace endpoint to be "tagged" with Would it be possible to somehow change the I'm actually trying to achieve multiple servicenames, within the same application and the servicename's are only known at runtime, when the trace/activity is started. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Not possible. Resource is immutable and once provider is built, you cannot change Resource. (Of course you can store service name as an attribute in Activity itself, instead of relying on Resource as a very hacky workaround) |
Beta Was this translation helpful? Give feedback.
Not possible. Resource is immutable and once provider is built, you cannot change Resource.
There is some work in OTel spec about a new concept of "Entities", which, when landed, might be what you need..... Sorry I don't have a better solution.
(Of course you can store service name as an attribute in Activity itself, instead of relying on Resource as a very hacky workaround)