-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
feat(opentelemetry): Do not use SentrySpan & Transaction classes #10982
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
Conversation
40aec25
to
353a940
Compare
Instead, we build the transaction event manually in the span exporter now. We also ensure to emit `spanStart` & `spanEnd` hooks now in the span processor.
353a940
to
fc0c077
Compare
|
||
const status = mapStatus(span); | ||
|
||
const spanJSON: SpanJSON = dropUndefinedKeys({ |
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.
Just wanna make sure: Are all of these calls to dropUndefinedKeys
necessary?
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 added them because tests failed because these were now on the event, so I think it's the safe bet to remove them?
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.
hm. If it is reasonable to do I would check if the tests are testing the right thing. Otherwise this is fine for now. The only concern is that if we don't do it now, we will do it never because we'll forget. Right now its not an issue but as soon as we use otel in the browser this will be a bundle size concern.
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.
we are basically testing what is passed to beforeSendTransaction
(in most cases), and IMHO it's correct to say these should not be there in that case 🤔 but I'll think about it some more (I may update this in a follow up)!
// TODO: remove the attributes here? | ||
attributes: removeSentryAttributes(span.attributes), |
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.
Can we elaborate this comment?
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 think we can stop sending these in the otel
context, because they are now basically the same thing as the trace.data
context, but need to double check if that is actually true 😅
We no longer need it, so we don't need to keep this manually around anymore 🎉 This is WIP on top of #10982
Instead, we build the transaction event manually in the span exporter now.
We also ensure to emit
spanStart
&spanEnd
hooks now in the span processor.With this, we can actually remove all the hub stuff from the otel package - I'll do this in a follow up!