Skip to content
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/java add data to all spans #12483

Merged
merged 6 commits into from
Feb 13, 2025
Merged

Conversation

lbloder
Copy link
Collaborator

@lbloder lbloder commented Jan 28, 2025

DESCRIBE YOUR PR

Fixes getsentry/sentry-java#4117

IS YOUR CHANGE URGENT?

Help us prioritize incoming PRs by letting us know when the change needs to go live.

  • Urgent deadline (GA date, etc.):
  • Other deadline:
  • None: Not urgent, can wait up to 1 week+

SLA

  • Teamwork makes the dream work, so please add a reviewer to your PRs.
  • Please give the docs team up to 1 week to review your PR unless you've added an urgent due date to it.
    Thanks in advance for your help!

PRE-MERGE CHECKLIST

Make sure you've checked the following before merging your changes:

  • Checked Vercel preview for correctness, including links
  • PR was reviewed and approved by any necessary SMEs (subject matter experts)
  • PR was reviewed and approved by a member of the Sentry docs team

LEGAL BOILERPLATE

Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. and is gonna need some rights from me in order to utilize my contributions in this here PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.

EXTRA RESOURCES

Copy link

vercel bot commented Jan 28, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
changelog ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 13, 2025 1:02pm
develop-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 13, 2025 1:02pm
sentry-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 13, 2025 1:02pm

Copy link

codecov bot commented Jan 28, 2025

Bundle Report

Changes will increase total bundle size by 70.36kB (0.34%) ⬆️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
sentry-docs-server-cjs 11.0MB 70.37kB (0.64%) ⬆️
sentry-docs-client-array-push 9.39MB -6 bytes (-0.0%) ⬇️

Affected Assets, Files, and Routes:

view changes for bundle: sentry-docs-server-cjs

Assets Changed:

Asset Name Size Change Total Size Change (%)
1729.js 23.14kB 1.73MB 1.35%
../instrumentation.js 23.14kB 1.07MB 2.22%
9523.js 23.14kB 1.04MB 2.27%
../app/[[...path]]/page.js.nft.json 314 bytes 376.7kB 0.08%
../app/platform-redirect/page.js.nft.json 314 bytes 376.62kB 0.08%
../app/sitemap.xml/route.js.nft.json 314 bytes 374.59kB 0.08%
view changes for bundle: sentry-docs-client-array-push

Assets Changed:

Asset Name Size Change Total Size Change (%)
static/chunks/pages/_app-*.js -3 bytes 865.35kB -0.0%
static/chunks/1298-*.js -3 bytes 401.61kB -0.0%
static/6mgugSITGDhHdO6BdTYVD/_buildManifest.js (New) 578 bytes 578 bytes 100.0% 🚀
static/6mgugSITGDhHdO6BdTYVD/_ssgManifest.js (New) 77 bytes 77 bytes 100.0% 🚀
static/1TwbHZ3GJaE-*.js (Deleted) -578 bytes 0 bytes -100.0% 🗑️
static/1TwbHZ3GJaE-*.js (Deleted) -77 bytes 0 bytes -100.0% 🗑️

Copy link
Member

@adinauer adinauer left a comment

Choose a reason for hiding this comment

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

Should we also document how to set data on SentryTracer / Span directly? Ah, that's already there: https://docs.sentry.io/platforms/java/tracing/instrumentation/custom-instrumentation/#improving-data-on-transactions-and-spans

@lbloder
Copy link
Collaborator Author

lbloder commented Feb 11, 2025

Should we also document how to set data on SentryTracer / Span directly? Ah, that's already there: https://docs.sentry.io/platforms/java/tracing/instrumentation/custom-instrumentation/#improving-data-on-transactions-and-spans

Ahh, good catch. The documentation regarding adding data to spans does not actually match how it currently works.

According to the docs linked above you should be able to do span.setData("key", "value") same as for the trace. However, span.setData actually overwrites the whole map

@adinauer
Copy link
Member

Ah, let's document how to use current API then rather than changing the SDK as then docs would only be usable for new versions. I think it's fine to keep the SDK as is as we're about to rewrite the Performance API anyways.

@lbloder
Copy link
Collaborator Author

lbloder commented Feb 12, 2025

Ah, let's document how to use current API then rather than changing the SDK as then docs would only be usable for new versions. I think it's fine to keep the SDK as is as we're about to rewrite the Performance API anyways.

So, I double checked. My bad, sorry. The documentation is fine as is.
ISpan does have a setData(key, value) as documented in the link.
I confused this with the part that we are documenting here in the PR where we set data on the SentrySpan which only has a setData(Map<String, String)

@adinauer adinauer marked this pull request as ready for review February 13, 2025 05:16
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.

Document how to attach data onto a transaction and all its spans
2 participants