[Api] support for adding default tags to tracer#6137
Conversation
|
@alimahboubi, it is good practice to execute build locally. In this case it should be done in Could you please fix it? |
- update "PublicAPI.Shipped" file
|
@Kielek Thanks for pointing that out! I've fixed the compilation error. I've also run a local build in Release mode to confirm |
…dding-default-tags-to-tracer
- Moved new GetTracer overload to the Unshipped file. - Updated GetTracer signature to include nullable `version` and `tags` parameters. - Removed the default parameter value from the previous line (existing GetTracer overload) as it was redundant after adding the new overload.
|
@Kielek Thanks for the detailed feedback! I've incorporated both of your suggestions:
I've updated the commit with these changes. Please take another look! |
Kielek
left a comment
There was a problem hiding this comment.
Your assertions are to weak. The goal is to have one instance per tags set. Now, you have multiple instances for the same set of tags.
If you include all changes, tests will be failing. You need to fix the TracerKey.
Kielek
left a comment
There was a problem hiding this comment.
Worth to add entry in CHANGELOG under OpenTelemetry.Api
…dding-default-tags-to-tracer # Conflicts: # src/OpenTelemetry.Api/CHANGELOG.md
Fixes #6016
Design discussion issue #6016
Changes
This pull request adds a new overload to the
TracerProvider.GetTracermethod to support the inclusion of tags, similar to the newActivitySourceconstructor overload in .NET 9. This allows users to associate initial tags with aTracer(and therefore the underlyingActivitySource), which can be used to differentiate application instances with different configurations. These tags are applied to all activities created by theActivitySource.The new overload is: