Skip to content
This repository has been archived by the owner on May 23, 2023. It is now read-only.

Add unwrap to interfaces #282

Open
jpkrohling opened this issue Jun 18, 2018 · 2 comments
Open

Add unwrap to interfaces #282

jpkrohling opened this issue Jun 18, 2018 · 2 comments

Comments

@jpkrohling
Copy link
Contributor

It would be useful to have a <T extends Span> unwrap() method on the Span interface (and similar methods on similar interfaces), similar to JPA's. It would make it easier to call implementation-specific methods.

Before:

    Span span = tracer.buildSpan("test-operation").start();
    long traceId = ((JaegerSpanContext) span.context()).getTraceId();

After:

    Span span = tracer.buildSpan("test-operation").start();
    long traceId = span.context().<JaegerSpanContext>unwrap().getTraceId();

Before:

    JaegerSpanContext expectedContext = (JaegerSpanContext) jaegerSpan.context();

After:

    JaegerSpanContext expectedContext = jaegerSpan.context().unwrap();
@sjoerdtalsma
Copy link
Contributor

Please note there is a bit of discussion in PR 211 about the desirability of adding this to the API

@tedsuo
Copy link
Member

tedsuo commented Jul 12, 2018

We may want to move this to a cross-language discussion as part of Trace Identifiers: opentracing/specification#123

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants