Skip to content

Conversation

@adinauer
Copy link
Member

@adinauer adinauer commented Apr 2, 2025

Closes getsentry/sentry-java#4104 and #12619

DESCRIBE YOUR PR

Tell us what you're changing and why. If your PR resolves an issue, please link it so it closes automatically.

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

@adinauer adinauer requested review from lbloder and lcian April 2, 2025 10:38
@vercel
Copy link

vercel bot commented Apr 2, 2025

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

Name Status Preview Comments Updated (UTC)
sentry-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 15, 2025 10:41am
2 Skipped Deployments
Name Status Preview Comments Updated (UTC)
changelog ⬜️ Ignored (Inspect) Visit Preview Apr 15, 2025 10:41am
develop-docs ⬜️ Ignored (Inspect) Visit Preview Apr 15, 2025 10:41am

@codecov
Copy link

codecov bot commented Apr 2, 2025

Bundle Report

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

Detailed changes
Bundle name Size Change
sentry-docs-server-cjs 11.14MB 2.8kB (0.03%) ⬆️
sentry-docs-client-array-push 9.47MB -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 -3 bytes 1.75MB -0.0%
../instrumentation.js -3 bytes 1.08MB -0.0%
9523.js -3 bytes 1.05MB -0.0%
../app/[[...path]]/page.js.nft.json 935 bytes 388.21kB 0.24%
../app/platform-redirect/page.js.nft.json 935 bytes 388.13kB 0.24%
../app/sitemap.xml/route.js.nft.json 935 bytes 386.1kB 0.24%
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 868.7kB -0.0%
static/chunks/8165-*.js -3 bytes 410.1kB -0.0%
static/B8jW1sr63krJd5XtR6NqQ/_buildManifest.js (New) 578 bytes 578 bytes 100.0% 🚀
static/B8jW1sr63krJd5XtR6NqQ/_ssgManifest.js (New) 77 bytes 77 bytes 100.0% 🚀
static/xQh2EQaiF5GtC7tBXClsq/_buildManifest.js (Deleted) -578 bytes 0 bytes -100.0% 🗑️
static/xQh2EQaiF5GtC7tBXClsq/_ssgManifest.js (Deleted) -77 bytes 0 bytes -100.0% 🗑️

Copy link
Member

@lcian lcian left a comment

Choose a reason for hiding this comment

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

I like the new more digestible structure and also the fact that this is gonna be much easier to find in the docs.

Overall it feels that we're assuming that the person who's reading this is already using our SDK and not using OTEL.
I would briefly mention the benefits you get on the other way around (should be obvious but you will benefit from your spans being sent to Sentry and all our features plus error monitoring) plus how it works (just need to mention that any spans you create using OTEL APIs are automatically sent to Sentry just by installing the SDK -- that's how it works in that case right?).
Maybe there's a better way to explain this using OTEL terms that they would already be familiar with, like "adding the Sentry SDK as a dependency will autoconfigure OTEL to export telemetry data to Sentry and the SDK will act as the exporter" or something like that (not sure if that's accurate though).
This is because I assume a lot of people reading this page will likely already have an OTEL setup going (as opposed to a Sentry setup going and willing to use OTEL).

Also there's some redundancy between the pages. If I navigate to /platforms/java/opentelemetry/setup/ I see the part about the agent (/platforms/java/opentelemetry/setup/agent/) which maybe you didn't intend to have show up in both places.

@adinauer
Copy link
Member Author

adinauer commented Apr 3, 2025

Overall it feels that we're assuming that the person who's reading this is already using our SDK and not using OTEL.
I would briefly mention the benefits you get on the other way around (should be obvious but you will benefit from your spans being sent to Sentry and all our features plus error monitoring) plus how it works (just need to mention that any spans you create using OTEL APIs are automatically sent to Sentry just by installing the SDK -- that's how it works in that case right?).
Maybe there's a better way to explain this using OTEL terms that they would already be familiar with, like "adding the Sentry SDK as a dependency will autoconfigure OTEL to export telemetry data to Sentry and the SDK will act as the exporter" or something like that (not sure if that's accurate though).
This is because I assume a lot of people reading this page will likely already have an OTEL setup going (as opposed to a Sentry setup going and willing to use OTEL).

I've created getsentry/sentry-java#4313 so we can further improve docs and explain what customers gain when adding Sentry.

Also there's some redundancy between the pages. If I navigate to /platforms/java/opentelemetry/setup/ I see the part about the agent (/platforms/java/opentelemetry/setup/agent/) which maybe you didn't intend to have show up in both places.

I did that on purpose to explain the agent in both locations. On the /setup page it's supposed to help figure out whether you want to use the Agent and on /setup/agent I didn't want to skip it because we're likely going to link to this page to tell customers what to use so I didn't want that page to leave out the explanation either.

Copy link
Member

@lcian lcian left a comment

Choose a reason for hiding this comment

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

Approving to unblock, we can improve this over time

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.

Looks good overall.
Much more digestible this way 👍

Left a few comments on some minor things


## Install

<PlatformContent includePath="performance/opentelemetry-install/without-java-agent" />
Copy link
Collaborator

Choose a reason for hiding this comment

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

In this include, we show Information about how to install without agent, and have a paragraph that mentions that there is a separate dependency for spring boot. The link to which points to: /platforms/java/guides/spring-boot/tracing/instrumentation/opentelemetry/. But, in my opinion, should point to: /platforms/java/guides/spring-boot/opentelemetry/setup/agentless/. WDYT?


### Capturing HTTP Headers

By default OpenTelemetry does not capture any HTTP headers. This, however, can be configured using system properties or environment variables as per OpenTelemetry's configuration documentation [here](https://opentelemetry.io/docs/zero-code/java/agent/instrumentation/http/#capturing-http-request-and-response-headers). Each variable is a comma-separated list of HTTP header names that should be captured.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Looks like something I forgot initially when creating this section. But should we add a disclaimer here to look out for PII in the headers?

sidebar_order: 200
---

If you do not want to use our recommended <PlatformLink to="/opentelemetry/setup/agent">Java Agent</PlatformLink>, we also offer a dependency that allows you to use OpenTelemetry with Sentry.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should we add an example use case here for when to use the agentless version instead of the agent, like when using GraalVM?
Could also be done in getsentry/sentry-java#4313

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah let's get this merged and improve later.

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 👍

@adinauer adinauer merged commit b5941d6 into master Apr 15, 2025
11 checks passed
@adinauer adinauer deleted the feat/improve-java-otel-docs branch April 15, 2025 11:51
bitsandfoxes pushed a commit that referenced this pull request Apr 24, 2025
* Improve Java OpenTelemetry docs

* try to fix lint

* try to fix lint2

* Apply suggestions from code review

Co-authored-by: Lukas Bloder <[email protected]>

* PR feedback

---------

Co-authored-by: Lukas Bloder <[email protected]>
@github-actions github-actions bot locked and limited conversation to collaborators May 1, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Explanation of what Java OTEL Agent does Split OpenTelemetry docs into multiple subpages

4 participants