Skip to content
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

Support OTEL_SERVICE_NAME #425

Open
dhiaayachi opened this issue Sep 5, 2024 · 2 comments
Open

Support OTEL_SERVICE_NAME #425

dhiaayachi opened this issue Sep 5, 2024 · 2 comments

Comments

@dhiaayachi
Copy link
Owner

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:

  • service.name = ${OTEL_SERVICE_NAME}.{history,frontend,matching}

else:

  • service.name= io.temporal.{history,frontend,matching}

Describe alternatives you've considered
None

@dhiaayachi
Copy link
Owner Author

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
Copy link
Owner Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant