-
Notifications
You must be signed in to change notification settings - Fork 888
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
Get Tracer operation should use an empty string if the specified name
is null
#1654
Get Tracer operation should use an empty string if the specified name
is null
#1654
Conversation
name
is null
@@ -110,7 +110,7 @@ This API MUST accept the following parameters: | |||
or application. | |||
In case an invalid name (null or empty string) is specified, a working | |||
Tracer implementation MUST be returned as a fallback rather than returning | |||
null or throwing an exception, its `name` property SHOULD keep the original invalid value, | |||
null or throwing an exception, its `name` property SHOULD be set to an **empty** string, |
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.
Should TracerProvider::GetTracer(null)
and TracerProvider::GetTracer("")
return the same Tracer
with ""
as 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.
Identity of the returned tracer is not relevant to the spec, as the only per-tracer state is the (immutable) Instrumentation Library name and version.
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. I am still a little bit unclear about "its name property SHOULD be set to an empty string." Does it mean the name property of the tracer should be set to empty string even if null
is passed to GetTracer
, but keep the name stored in Instrumentation Library as null
which is the original value passed to GetTracer
?
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.
Probably we need a further clarification, but the idea is that Get Tracer (null)
essentially becomes a call to Get Tracer ("")
(with name exactly being from this point "", which will be used also in the stored instrumentation).
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.
Get Tracer(null)
becomes a call to Get Tracer("")
is very clear to me. I think further clarification will be helpful to guide implementations.
Co-authored-by: John Watson <jkwatson@gmail.com>
Fixes #1619 - as discussed previously in a previous SIG call.
The
Get Tracer
operation, upon receiving an invalid value, should set thename
to an empty string, instead of allowing null values to pass through.