feat(otel): Add basic SentrySpanProcessor#6023
Merged
AbhiPrasad merged 4 commits intomasterfrom Oct 28, 2022
Merged
Conversation
This was referenced Oct 24, 2022
c9bd9dc to
fec3f55
Compare
Contributor
size-limit report 📦
|
5ed079c to
e53ee52
Compare
Member
|
Pushed changes:
Especially 1. allowed to remove some stuff (no need to keep the parent span in the internal map anymore, for example). |
mydea
reviewed
Oct 27, 2022
| startChild( | ||
| spanContext?: Pick<SpanContext, Exclude<keyof SpanContext, 'spanId' | 'sampled' | 'traceId' | 'parentSpanId'>>, | ||
| ): Span; | ||
| startChild(spanContext?: Pick<SpanContext, Exclude<keyof SpanContext, 'sampled' | 'traceId' | 'parentSpanId'>>): Span; |
mydea
reviewed
Oct 27, 2022
| */ | ||
| export class SentrySpanProcessor implements OtelSpanProcessor { | ||
| // public only for testing | ||
| public readonly _map: Map<SentrySpan['spanId'], SentrySpan> = new Map<SentrySpan['spanId'], SentrySpan>(); |
Member
There was a problem hiding this comment.
It's not super nice to make this public just so we can use it in tests, so if there are other ideas for this, let me know. It works, at least 😅
Also FYI I changed this to a Map instead of {}, as that makes delete() nicer imho. I think there shouldn't really be a perf difference, but let me know if we should rather leave this a POJO.
Contributor
Author
There was a problem hiding this comment.
Using a map seems fine to me - cleaner pattern overall.
mydea
approved these changes
Oct 27, 2022
Member
mydea
left a comment
There was a problem hiding this comment.
LGTM. I think this is a solid start!
e53ee52 to
d558320
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implement a basic
SpanProcessorfor OpenTelemetry.This is very much WIP! The usage will be something like this:
The processor will automatically convert all otel spans into sentry transactions/spans, and keep the correct parent-child relationship.
ref #6000