-
Notifications
You must be signed in to change notification settings - Fork 828
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
feat: add span processor #136
Conversation
Codecov Report
@@ Coverage Diff @@
## master #136 +/- ##
==========================================
- Coverage 94.31% 91.69% -2.62%
==========================================
Files 47 48 +1
Lines 1777 1349 -428
Branches 117 94 -23
==========================================
- Hits 1676 1237 -439
- Misses 101 112 +11
|
031d1e4
to
e5298fa
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is flexible enough. Can every method call be hooked into instead? Also, maybe event emitters are better suited for this use case?
I'd rather avoid event emitters if possible since I think they are Node-specific. @rochdev what are the use cases you have in mind for hooking into the other methods of I guess my thinking is that if the most common cases involve exporters that would operate on a span when it ends, then the extra code (JS bytes for the browser) and complexity of arbitrary hooks might not be needed in the basic |
👍 This seems like a good start. Maybe the wrong PR to discuss this on, but one of the main benefits of having hooks/event emitters for every span method is you can then stream to a sidecar rather than going through an exporter, eliminating all buffering and most span state in the application (you'd need to maintain the span context but that's it). An implementation like that though would probably replace the SDK. @rochdev I'm also curious, are there any hook/event emitter examples you have in mind? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the idea. Lifecycle hooks make life much easier and this is a good start.
Per the SIG: we agreed that lifecycle hooks are valuable and should be implemented with a simple callback-based mechanism. |
e5298fa
to
d87966a
Compare
To give a bit more context, at Datadog we have many features outside of the capability of OpenTelemetry, and we need to be able to call specific methods that are vendor-specific at different times during the lifecycle of the tracer. This is also not limited to By having hooks for every function available on every class of the tracer, it would allow us to support OpenTelemetry without requiring the user to choose between using OpenTelemetry with less features or not using it to get more features. |
1215a37
to
8fcad43
Compare
Co-authored-by: Valentin Marchaud <[email protected]>
Co-authored-by: Valentin Marchaud <[email protected]>
…dis-4.x chore(deps): update dependency @types/ioredis to v4.17.2
Idea: The
SpanProcessor
interface allows users to build frameworks like exporter/z-pages/etc. TheSpanProcessor
interface should allow interceptingSpan
s immediately after start and immediately after end.OpenCensus contains the same kind of interface:
https://github.com/census-instrumentation/opencensus-node/blob/056523d83d21449e3bd888fec624d33c129951cc/packages/opencensus-core/src/trace/model/types.ts#L261-L266
This exist in java but aren't yet included in the spec.