dhiaayachi / temporal

Temporal service
https://docs.temporal.io
MIT License
0 stars 0 forks source link

Support OTEL_SERVICE_NAME #425

Open dhiaayachi opened 2 weeks ago

dhiaayachi commented 2 weeks ago

Is your feature request related to a problem? Please describe. No way to set a custom service.name in the trace. If several teams in an orgs spawn and manage their own cluster, they all appear under the same service name.

It would be pretty useful to customize the service.name, by allowing to set a prefix for example?

Describe the solution you'd like Use OTEL_SERVICE_NAME env var to customize the service.name in the trace.

If OTEL_SERVICE_NAME is set:

else:

Describe alternatives you've considered None

dhiaayachi commented 1 day ago

Thank you for your feature request!

This is a good suggestion, and we appreciate you bringing it to our attention. Temporal currently uses the service name from the Temporal Server, but your suggested approach using the OTEL_SERVICE_NAME environment variable would allow for more granular control over service naming in traces. This would be particularly helpful for organizations using multiple Temporal clusters.

For now, a possible workaround is to use a convention for naming services within your organization. For example, you could prefix service names with the team name or the cluster name. This would help to distinguish services from different teams or clusters even though they are all using the same Temporal Server.

We are looking into implementing your suggested feature, and we'll keep you updated on our progress.

dhiaayachi commented 1 day ago

Thank you for your feature request.

Currently, there isn't a way to directly set a custom service.name in the trace. However, you can use the OTEL_SERVICE_NAME environment variable to achieve a similar result. This environment variable will be used to prefix the generated service.name.

For example, if you set OTEL_SERVICE_NAME=my-team-service, the service.name in the trace would be:

my-team-service.history
my-team-service.frontend
my-team-service.matching

You can find more information about the OTEL_SERVICE_NAME environment variable in the OpenTelemetry specification: https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/sdk-environment-variables.md