-
Notifications
You must be signed in to change notification settings - Fork 626
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
Update gettracer #1854
Update gettracer #1854
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR, nice work! Please update the changelog and i'll approve.
CHANGELOG.md
Outdated
@@ -36,6 +36,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 | |||
([#1809])(https://github.com/open-telemetry/opentelemetry-python/pull/1809) | |||
- Fixed sequence values in OTLP exporter not translating | |||
([#1818](https://github.com/open-telemetry/opentelemetry-python/pull/1818)) | |||
- Update get_tracer to return an empty string when passed an invalid name |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be added to the "Unreleased" section of the changelog
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just did it. Thanks!
self.assertEqual( | ||
tracer1.instrumentation_info, tracer2.instrumentation_info | ||
) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
any reason for this test to be moved?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believed that having the more granular tests for the individual tracer would provide more information upon failing; then, this test just makes sure that the two tracers created are identical, which is asserted after each individual attribute is checked. I'm not sure if that's good practice, though, so I'd appreciate the feedback!
Co-authored-by: alrex <[email protected]>
Code looks good, please update the branch so we can merge it. |
@eddyleelin please fix the linting issues. |
Thanks so much to everyone for the patience, support, and helpful feedback! I really appreciate this community!! @codeboten @owais @lzchen |
Description
Specification change #1654 requires invalid names to be converted to an empty string, as described in the tracer specification below. Passing
None
or the empty string""
as thename
parameter totrace.get_tracer(name, version)
will now return a tracer with an empty string fortracer.instrumentation_info.name
. Full details available in the Trace API specifications.Fixes #1849
How Has This Been Tested?
get_tracer
for the given invalid inputs, and thetox -e test-core-sdk
tests passed.Does This PR Require a Contrib Repo Change?
Checklist:
Hooray for my first PR!