-
Notifications
You must be signed in to change notification settings - Fork 848
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
Why is there a DefaultSpan? #1135
Comments
@carlosalberto Can probably answer this more completely than I can, but the purpose of the DefaultSpan is to provide an implementation when there is no SDK installed. The implementation does context propagation but nothing else. |
I don't think that's the only reason, because such default implementation can be done without exposing the DefaultSpan as a public class in the API. |
Looks like the only usage that's keeping it from being made package-access is in the |
@yurishkuro I am happy to work on making the default implementations not public. Would also be good to make this call across different languages, currently looking for example at go https://godoc.org/go.opentelemetry.io/otel/api/trace there a Noop public types. I think it is good to be consistent. |
Well, having I'd like us to offer a way to keep this, if possible (by keeping a method somewhere, that returns an empty |
Can you be specific? What does it allow? |
Hey @yurishkuro So it allows users to use a Context context = TracingContextUtils.withSpan(DefaultSpan.create(spanContext)); // OR
Scope scope = TracingContextUtils.currentContextWithSpan(DefaultSpan.create(spanContext)); But perhaps that's the only important case we need to support. I see two alternatives:
public static Scope currentContextWithSpanContext(SpanContext spanContext) {
return currentContextWithSpan(DefaultSpan.create(spanContext));
} |
This sounds like a private contract between the SDK Tracer and the base Propagator. It could be all encapsulated in the base propagator, with Tracer having no knowledge of how the span/spancontext are stored in the Context. |
@yurishkuro there are two use-cases:
|
Just recently I saw several questions in OpenTracing about "how can I create a NoopSpan", "why my NoopSpan is being rejected", etc. - having API concerts like DefaultSpan invites these questions. |
Drive by comment, we're using this library and interoperating with it and having the following would help:
|
Closing as now we have this as |
This will be resolved by #1704, so yes! |
There is no such concept in the specification, but this class is present in the Java API.
https://github.com/open-telemetry/opentelemetry-java/blob/efc49522ac4fd01bcf94afa60789264515aa75cd/api/src/main/java/io/opentelemetry/trace/DefaultSpan.java
Can it not be hidden inside the SDK as implementation detail?
The text was updated successfully, but these errors were encountered: