Add support for global metric and tracing tags #518
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Closes [Feature Request] Support custom tags/labels in TelemetryOptions #467
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
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.