dd-trace-rb
dd-trace-rb copied to clipboard
Ability to easily set service prefix for automatic instrumentation
If there are multiple services with automatic instrumentation turned on,
it convenient to have the DataDog service names distinguished by the
actual service/application that produced the metrics. In this commit it
is suggested to add DD_SERVICE_PREFIX
env variable to control this.
👋 @vbyno, thank you for the contribution.
The service name default behaviour has been a complex issue in ddtrace
for a while. I'll bring it to my team meeting this week to discuss how we'd like to proceed regarding your PR.
👋 @vbyno, sorry for the super late response.
We've release the ddtrace
v1.0 series recently and we've revamped the way service name is propagated to nested spans.
Currently, we recommend setting only one global service name, through the DD_SERVICE=my-service
environment variable or Datadog.configure{|c| c.service = 'my-service'}
. This way only important services will get their own service names, and internal spans will inherit DD_SERVICE
. This should allow for a cleaner Datadog UI experience.
Let me know if this works for you, or why it doesn't work if that's the case.