Skip to content

Add support for global metric and tracing tags #518

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

Merged
merged 2 commits into from
Mar 24, 2023

Conversation

ytaben
Copy link
Contributor

@ytaben ytaben commented Mar 24, 2023

What was changed

Add support for passing a map of tags for metrics and traces

Why?

Currently - core SDK uses a single service.name tag (that cannot be overriden)
Many users, however, may want to supply their own (for example, to identify service or host running a worker or making client requests)

Checklist

  1. Closes [Feature Request] Support custom tags/labels in TelemetryOptions #467

  2. How was this tested:

Tested with a local otel collector and temporal SDK python.
Note: I used an older commit because python does not seem to compile with latest SDK.
Ensured a custom tag set in Python gets propagated to the collector (along service.name tag)

Did not test prometheus as we don't use it but can upon request

  1. Any docs updates needed?
    Probably not

We don't use opentelemetry so maybe variables aren't most aptly named so open to feedback on that (in datadog these are just tags)

Also, I added the functionality to both traces and metrics. I don't see why not do both but let me know if we want to do this for metrics-only.

@ytaben ytaben marked this pull request as ready for review March 24, 2023 20:25
Copy link
Member

@Sushisource Sushisource left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool! Thanks for this. Makes sense to me.

You'll want to run cargo fmt which is what the CI is complaining about.

@ytaben
Copy link
Contributor Author

ytaben commented Mar 24, 2023

Ah, though it was lint (tried clippy)
Sadly contributors can't see buildkite output

@Sushisource Sushisource enabled auto-merge (squash) March 24, 2023 21:33
@Sushisource Sushisource merged commit 6146ed5 into temporalio:master Mar 24, 2023
@ytaben ytaben deleted the ytaben/metric-tags branch March 24, 2023 21:59
Sushisource pushed a commit to Sushisource/sdk-core that referenced this pull request May 12, 2023
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

Successfully merging this pull request may close these issues.

[Feature Request] Support custom tags/labels in TelemetryOptions
2 participants