Skip to content

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

Merged
merged 3 commits into from
Mar 8, 2024

Conversation

mydea
Copy link
Member

@mydea mydea commented Mar 8, 2024

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!

@mydea mydea requested review from lforst, Lms24 and AbhiPrasad March 8, 2024 11:47
@mydea mydea self-assigned this Mar 8, 2024
@mydea mydea force-pushed the fn/otel-start-span branch 2 times, most recently from 40aec25 to 353a940 Compare March 8, 2024 12:44
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.
@mydea mydea force-pushed the fn/otel-start-span branch from 353a940 to fc0c077 Compare March 8, 2024 12:45

const status = mapStatus(span);

const spanJSON: SpanJSON = dropUndefinedKeys({
Copy link
Contributor

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?

Copy link
Member Author

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?

Copy link
Contributor

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.

Copy link
Member Author

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)!

Comment on lines +189 to +190
// TODO: remove the attributes here?
attributes: removeSentryAttributes(span.attributes),
Copy link
Contributor

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?

Copy link
Member Author

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 😅

@mydea mydea merged commit 8d0b779 into develop Mar 8, 2024
@mydea mydea deleted the fn/otel-start-span branch March 8, 2024 15:53
mydea added a commit that referenced this pull request Mar 11, 2024
We no longer need it, so we don't need to keep this manually around
anymore 🎉

This is WIP on top of
#10982
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

Successfully merging this pull request may close these issues.

2 participants