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

SDK: Lifecycle [Listener|Decorator|Interceptor] for [Scope|Span] #295

Closed
tylerbenson opened this issue May 13, 2019 · 10 comments
Closed

SDK: Lifecycle [Listener|Decorator|Interceptor] for [Scope|Span] #295

tylerbenson opened this issue May 13, 2019 · 10 comments
Labels

Comments

@tylerbenson
Copy link
Member

We should have a way to be notified of state changes for these important objects such as:

Span

  • afterStart(span)
  • beforeFinish(span)

Scope

  • updated(old, new)

Span Builder (maybe?)

  • beforeStart(builder)

We may want to be able to define these on each span/scope instance, a span.builder, or on the tracer which would be applied to each individual instance automatically.

These types of hooks are useful for supporting features like MDC.

@tylerbenson
Copy link
Member Author

tylerbenson commented May 13, 2019

Partially defined in #278 and perhaps related to #276

@bogdandrutu
Copy link
Member

@tylerbenson why before end?

@bogdandrutu
Copy link
Member

Except the Scope the other two requests should go into the related issues that you linked.

@tylerbenson
Copy link
Member Author

tylerbenson commented May 14, 2019

@bogdandrutu (I admit I didn't see those other issues first but,) since they're closely related I think it makes sense to think of the proper design holistically, rather than each independently.

why before end?

That can probably be dropped, but I added it for consistency with start.

@bogdandrutu
Copy link
Member

We need an afterEnd API to implement exporters. See #264 for more details, also there is a link on how I plan to build the export framework on top of this API

@bogdandrutu bogdandrutu changed the title Lifecycle [Listener|Decorator|Interceptor] for [Scope|Span] SDK: Lifecycle [Listener|Decorator|Interceptor] for [Scope|Span] May 14, 2019
@bogdandrutu
Copy link
Member

@tylerbenson can you explain about the Scope interceptor?

@tylerbenson
Copy link
Member Author

There's pretty detailed discussion about it here and here, but the gist is it would be useful to have this functionality to support things like MDC coordination and JFR reporting. (I think the best consensus proposal from that discussion was this one, but I think there are still some kinks to work out.)

@trask
Copy link
Member

trask commented Feb 20, 2020

Scope listener would be particularly useful, so that current span context can be sync'd with logging context (MDC), which is needed in order to correlate logs with traces (e.g. open-telemetry/opentelemetry-java-instrumentation#133).

@Oberon00
Copy link
Member

Oberon00 commented Feb 21, 2020

I think this issue is using concepts that mostly don't apply anymore. I'd vote for closing it and opening a new issue (maybe in the spec?) if there are still open points not covered by SpanProcessor already.

@bogdandrutu
Copy link
Member

bogdandrutu commented Feb 25, 2020

@Oberon00 The major remaining part is the Context changes interceptor.

@tylerbenson will close this and open a new issue just for the Context interceptor.

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

No branches or pull requests

4 participants