-
Notifications
You must be signed in to change notification settings - Fork 834
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
TracerRegistry: set name to default
#679
Comments
I'm not sure I agree that this is a good idea. For one thing, the specification states that |
Hmm, this is a valid concern. I think intention was to make |
I think if that is the concern, I would rather update the |
Just did the comparison with other libraries. Looks like good names should solve the issue. Go: /~https://github.com/open-telemetry/opentelemetry-go/blob/master/example/basic/main.go#L73 Python: /~https://github.com/open-telemetry/opentelemetry-python/blob/master/examples/basic_tracer/tracer.py#L45 (name of the current module) @obecny WDYT? |
@dyladan the spec on one hand says that name is required but then it also says that when name is invalid |
"working default tracer implementation" could be noop tracer. This is just to prevent invalid use of the API from causing crashes. For example, if a js library implements OpenTelemetry but calls the API incorrectly and leaves out a name, the worst case should be that they get no traces. It should never crash the program. In my opinion, "required" is very unambiguous and making the property optional in the types will imply to most users they they really don't need it. 99% of users will not read the documentation and many that do won't read it thoroughly. We should keep the property non-optional in the types.
Totally agree that "default" is a bad name and should not be in the examples. That's why I think we should use good names like "http-example-client".
I'm currently working on a denylist implementation where you disable instrumentation by name. I will add an example that shows how it is used. |
whoops @dyladan I think I edited your response adding mine, not sure why is this even possible :/ |
Let me copy the whole sentence
|
@dyladan copied from email, should be fine now |
The No-Op tracer is a working tracer, it just accomplishes a different goal. Notice the examples of "not working" are null or throw. In any case, a name is not optional and we should do everything in our power to ensure that it is used correctly. Returning a no-op tracer if name is excluded would force library developers to include a name, while at the same time not causing crashes in applications which have misused it. |
Originates from #582 (review)
In case of
TracerRegistry
'sgetTracer(name, version)
method, usedefault
name when an invalid name (null or empty string) is specified. With this, we can removedefault
name from all the examples :.getTracer('default’);
=>.getTracer();
.Specs: /~https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/api-tracing.md#obtaining-a-tracer
The text was updated successfully, but these errors were encountered: