Skip to content
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

Add tracer construction spec #135

Merged

Conversation

pavolloffay
Copy link
Member

Resolves #39

Signed-off-by: Pavol Loffay ploffay@redhat.com

Signed-off-by: Pavol Loffay <ploffay@redhat.com>
@yurishkuro
Copy link
Member

I have a couple concerns here.

  • Not sure how language-neutral the proposed pattern is. In Go people often have very strong feelings against registration pattern.
  • I think there have been many asks in OpenTracing where people use multiple tracers per process, so using words like "MUST use opentelemetry.GetTracer()" sounds too rigid

Copy link
Member

@songy23 songy23 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think tracer should be part of tracing-api.md?

@carlosalberto
Copy link
Contributor

Hey @pavolloffay thanks for cooking this PR.

As Yuri said, I think stating "MUST" for using OpenTelemetry.getTracer() is indeed strong - probably it's better to leave it as a recommendation only.

Also, automatic registration (i.e. what TracerProvider does) may not even be possible in all the languages (in Python, for example). Perhaps we can mention this as a possible route for languages to register OpenTelemetry.get*() members, or else fallback to manual registration.

@pavolloffay
Copy link
Member Author

I think there have been many asks in OpenTracing where people use multiple tracers per process, so using words like "MUST use opentelemetry.GetTracer()" sounds too rigid

I think we should look at it from the other side. We should assure that the registry always returns a valid tracer so the instrumentations can bind to it.

Signed-off-by: Pavol Loffay <ploffay@redhat.com>
Signed-off-by: Pavol Loffay <ploffay@redhat.com>
Signed-off-by: Pavol Loffay <ploffay@redhat.com>
Copy link
Member

@songy23 songy23 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@iredelmeier iredelmeier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 for @yurishkuro's concerns.

In particular, an assumption that OpenTelemetry.getTracer() returns a valid (i.e., non-null) tracer is quite different from assuming that it is the desired tracer. There are many reasons why users may want to avoid relying on a global tracer.

@SergeyKanzhelev
Copy link
Member

@iredelmeier for libraries instrumentation there must be a way to obtain the Tracer without the need to accept it as an argument thru dependency injection. Thus OpenTelemetry.getTracer() must exists. Even if customer is not relying on it. Do you envision a future when every library takes OpenTelemetry object as an argument on construction?

As for non-null - an implementation of this registry may be very language specific. But I'd say the requirement for it to be non null is quite important to avoid undesired NullReferenceExceptions. It's not too hard to return an noop tracer.

@iredelmeier
Copy link
Member

@iredelmeier for libraries instrumentation there must be a way to obtain the Tracer without the need to accept it as an argument thru dependency injection. Thus OpenTelemetry.getTracer() must exists. Even if customer is not relying on it. Do you envision a future when every library takes OpenTelemetry object as an argument on construction?

One in which every library requires providing a tracer? No. One in which libraries are at least advised to enable overriding the global? Yes.

As for non-null - an implementation of this registry may be very language specific. But I'd say the requirement for it to be non null is quite important to avoid undesired NullReferenceExceptions. It's not too hard to return an noop tracer.

My thoughts exactly! e.g., in OpenTracing there's the concept of a NoopTracer, which conforms to the same interface but (as the name implies) doesn't actually do anything. (I'd actually argue that OpenTelemetry should take this a step further with, e.g., a NoopSpan, but that's a separate conversation.)

@SergeyKanzhelev
Copy link
Member

@iredelmeier I suggest we file a feedback item to expand this description for the languages that uses DI extensively and have a practice of constructing SDKs and providing OT object explicitly. In any case there must be some global object to get as minimum the default (noop) tracer.

So I suggest we merge this one and formulate it better later.

I'd need this update personally for C#, but not ready to generalize it properly as a spec

@SergeyKanzhelev
Copy link
Member

Created: #143

@SergeyKanzhelev SergeyKanzhelev added this to the API proposal done milestone Jun 21, 2019
Copy link
Contributor

@tedsuo tedsuo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@SergeyKanzhelev SergeyKanzhelev merged commit e9340d7 into open-telemetry:master Jun 21, 2019
SergeyKanzhelev pushed a commit to SergeyKanzhelev/opentelemetry-specification that referenced this pull request Feb 18, 2020
* Add tracer construction spec

Signed-off-by: Pavol Loffay <ploffay@redhat.com>

* Move to tracing-api and fix comments

Signed-off-by: Pavol Loffay <ploffay@redhat.com>

* Small fixes

Signed-off-by: Pavol Loffay <ploffay@redhat.com>

* Fix dot

Signed-off-by: Pavol Loffay <ploffay@redhat.com>
rockb1017 pushed a commit to rockb1017/opentelemetry-specification that referenced this pull request Nov 18, 2021
* serverless configuration

* Update specification/configuration.md

Co-authored-by: Steve Flanders <sflanders@splunk.com>

* spec review open-telemetry#1

* Update specification/configuration.md

Co-authored-by: Robert Pająk <rpajak@splunk.com>

* Update specification/configuration.md

Co-authored-by: Robert Pająk <rpajak@splunk.com>

* Update specification/configuration.md

Co-authored-by: Robert Pająk <rpajak@splunk.com>

* spec review

* spec review

* review meeting outcome

* post-discussion changes

* Update specification/configuration.md

Co-authored-by: Steve Flanders <sflanders@splunk.com>

Co-authored-by: Steve Flanders <sflanders@splunk.com>
Co-authored-by: Robert Pająk <rpajak@splunk.com>
carlosalberto pushed a commit to carlosalberto/opentelemetry-specification that referenced this pull request Oct 31, 2024
* Add tracer construction spec

Signed-off-by: Pavol Loffay <ploffay@redhat.com>

* Move to tracing-api and fix comments

Signed-off-by: Pavol Loffay <ploffay@redhat.com>

* Small fixes

Signed-off-by: Pavol Loffay <ploffay@redhat.com>

* Fix dot

Signed-off-by: Pavol Loffay <ploffay@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Document Java API: Tracer construction
8 participants