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

Remove SpanBuilder.startScopedSpan() #33

Closed
carlosalberto opened this issue Apr 2, 2019 · 3 comments
Closed

Remove SpanBuilder.startScopedSpan() #33

carlosalberto opened this issue Apr 2, 2019 · 3 comments
Assignees

Comments

@carlosalberto
Copy link
Contributor

As part of OT 0.32 we deprecated a few members (opentracing/opentracing-java#291 details the reasons to do this).

As part of this, I'd also like to see startScopedSpan() gone.

@tedsuo
Copy link
Contributor

tedsuo commented Apr 2, 2019

Need @bogdandrutu to make this call.

@carlosalberto can you add a TL DR as to the reasoning for it's removal?

@carlosalberto
Copy link
Contributor Author

So we are actually trying to prevent bad use of the API:

try (Scope scope = tracer.spanBuilder("myOperation").startScopedSpan()) {
} catch (IOException e) {
  // scope/span are gone, there's no way to report errors.
}

Instead, we are asking the users to do this:

Span span = tracer.buildSpan("myOperation").startSpan();
try (Scope scope = tracer.withSpan(span)) {
} catch (IOException e) {
  span.putAttribute(...);
} finally {
  span.end();
}

The OC documentation does mention this, but nevertheless, we would go a little bit far and remove this one ;)

@bogdandrutu
Copy link
Member

Fine to remove it in the first version of the API and revisit this for a newer version.

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

No branches or pull requests

3 participants