Skip to content

POTEL 55 - Fix startChild for span that is not in current OTel Context #3862

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 10 commits into from
Nov 11, 2024

Conversation

adinauer
Copy link
Member

@adinauer adinauer commented Nov 8, 2024

📜 Description

OtelSpanFactory now sets the OtelSpanWrappers underlying OTel span as current span in the Context used when creating a new child span so the Context that arrives in the span processor has the correct parent set.

💡 Motivation and Context

Starting a child span from a transaction that wasn't in the current Context lead to multiple transactions being created (one for the transaction and another per span created).

💚 How did you test it?

📝 Checklist

  • I reviewed the submitted code.
  • I added tests to verify the changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • I updated the docs if needed.
  • Review from the native team if needed.
  • No breaking change or entry added to the changelog.
  • No breaking change for hybrid SDKs or communicated to hybrid SDKs.

🔮 Next steps

Sorry, something went wrong.

…or no agent
Copy link
Contributor

github-actions bot commented Nov 8, 2024

Fails
🚫 Please consider adding a changelog entry for the next release.
Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Instructions and example for changelog

Please add an entry to CHANGELOG.md to the "Unreleased" section. Make sure the entry includes this PR's number.

Example:

## Unreleased

- POTEL 55 - Fix `startChild` for span that is not in current OTel `Context` ([#3862](https://github.com/getsentry/sentry-java/pull/3862))

If none of the above apply, you can opt out of this check by adding #skip-changelog to the PR description.

Generated by 🚫 dangerJS against 57ac7d9

Copy link
Contributor

github-actions bot commented Nov 8, 2024

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 418.08 ms 469.06 ms 50.98 ms
Size 1.65 MiB 2.31 MiB 672.94 KiB

Previous results on branch: feat/potel-55-non-current-span-start-child

Startup times

Revision Plain With Sentry Diff
8e60d58 369.69 ms 457.40 ms 87.71 ms

App size

Revision Plain With Sentry Diff
8e60d58 1.70 MiB 2.36 MiB 671.45 KiB

Copy link
Collaborator

@lbloder lbloder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

Base automatically changed from feat/potel-54-cleanup to 8.x.x November 11, 2024 15:42
@adinauer adinauer merged commit 73d19e1 into 8.x.x Nov 11, 2024
16 of 22 checks passed
@adinauer adinauer deleted the feat/potel-55-non-current-span-start-child branch November 11, 2024 15:49
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.

None yet

2 participants