Title: Performance powered by OpenTelemetry (POTel) · Issue #3436 · getsentry/sentry-java · GitHub
Open Graph Title: Performance powered by OpenTelemetry (POTel) · Issue #3436 · getsentry/sentry-java
X Title: Performance powered by OpenTelemetry (POTel) · Issue #3436 · getsentry/sentry-java
Description: We want to use OpenTelemetry for the Sentry Java SDK. It should be possible to use OpenTelemetry API as well as Sentry API and still have both end up in Sentry. Research Issue More details H: Restore instrumenter code in Scopes #3697 Tes...
Open Graph Description: We want to use OpenTelemetry for the Sentry Java SDK. It should be possible to use OpenTelemetry API as well as Sentry API and still have both end up in Sentry. Research Issue More details H: Resto...
X Description: We want to use OpenTelemetry for the Sentry Java SDK. It should be possible to use OpenTelemetry API as well as Sentry API and still have both end up in Sentry. Research Issue More details H: Resto...
Opengraph URL: https://github.com/getsentry/sentry-java/issues/3436
X: @github
Domain: github.com
IPv4 address: 140.82.112.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Performance powered by OpenTelemetry (POTel)","articleBody":"We want to use OpenTelemetry for the Sentry Java SDK. It should be possible to use OpenTelemetry API as well as Sentry API and still have both end up in Sentry.\n\n- [Research Issue](https://github.com/getsentry/sentry-java/issues/3232)\n- [More details](https://github.com/getsentry/team-sdks/issues/4)\n\nH:\n- [x] Restore instrumenter code in `Scopes` https://github.com/getsentry/sentry-java/pull/3697\n- [x] Test updating op / description (op and description might have been overriden in SentrySpanExporter:204)\n- [x] More testing for the \"no agent\" scenario\n\nM:\n- [ ] Offer `createSpan` in Sentry API\n- [ ] Offer `createInactiveSpan` in Sentry API\n- [ ] Make `SentryTracer.makeCurrent` work\n- [ ] Implement `createSpan` for default span factory\n- [x] Implement some magic to enable OTel span factory automatically when OTel is available (+ opt out of magic?)\n- [ ] Add a more complex service using Spring Boot to https://github.com/getsentry/opentelemetry-demo and showcase errors and other features Sentry has to offer (copied from #2419)\n- [x] End2End Tests on Running application (copied from #2419)\n\nFigure out whether to include these in v8:\n- [ ] Add `setAttribute` methods and deprecate old API (maybe deprecate in v8, remove in v9 likely)\n\t- [ ] tbd when we actually want to do this\n- [ ] Make old API write to span attributes, tbd if we actually want to do this and how this should work in detail\n- [ ] should we clear out old finished spans after a while in `SentrySpanExporter`?\n\nL:\n- [ ] is detecting a version mismatch between application and agent possible to warn the user\n- [ ] Create transaction in DefaultSpanFactory.createSpan\n- [ ] Fix classloader for `sentry-opentelemetry-bootstrap` module to actually be bootstrap classloader\n\t- [ ] This is currently loaded via the agent classloader due to `implementation(projects.sentryOpentelemetry.sentryOpentelemetryBootstrap)` in `sentry-opentelemetry-agentcustomization/build.gradle`\n\t- [ ] Fixing this causes `ClassNotFound` exception in `OtelSpanWrapper` due to `ReadWriteSpan` not being available in the bootstrap classloader. We have to figure out how to handle this. OTel probably already has a workaround for this. Likely using shading and proxy objects. needs investigation\n- [ ] Maybe optimize context forking happening too often when already wrapped but rewrapped by OTel `ArrayBaseContext`\n- [ ] ~~Make measurements work~~\n- [ ] ~~Make metrics work~~\n- [ ] Check if we want to support span `Contexts` by writing to root span or mark it internal as it currently wouldn't work for non root spans\n- [ ] What should `transaction.finish` do for OTel? Finish all child spans? Root span could hold a list of children (weakly)\n- [ ] Make `scheduleFinish` work\n- [ ] Make finish callback work\n- [ ] Make finish options work (dropIfNoChildren, Hint)\n- [ ] Make forceFinish work\n- [ ] Make getSpans work\n- [ ] Implement `getEventId` on OTel transaction wrapper\n - [ ] In theory we shouldn't be using `getEventId()` as only the `SentryTracer` instance created by `SentrySpanExporter` should be queried for its event id. In theory a customer could call `getEventId` on the `OtelTransactionSpanForwarder` returned by `startTransaction`. This ID wouldn't match the real event ID. We'd have to force the ID used by `SentryTracer`, e.g. via `SpanOptions` or similar or simply use span ID (+ maybe trace ID concatenated).\n- [ ] Once the more complex demo has been merged, revert the adservice close to original state and showcase how easy it is to use Sentry for OTEL even without changing the target application\n\nSubtasks:\n- [x] Tracing #3445 and #3455\n - [x] Continue an incoming trace\n - [x] Attach trace to outgoing requests\n - [x] Make Sentry API for retrieving baggage etc. work\n - [x] Make Sentry API for continuing a trace work\n- [x] Sentry Span `op` and OTel span `name` can be updated independent of each other and diverge, fix #3468\n- [x] ~~Configurable POTel vs legacy OTel mode (e.g. by having a separate JAR)~~\n- [x] Sentry status should use OTel status #3439\n- [x] Make tracesSamplingDecision work #3462\n- [x] Figure out what to do with `instrumenter` - it is no longer needed\n- [x] How do we want to deal with multi init and OTel [#3674], [#3675], [#3676]\n- [x] Make startTimestamp on SpanOptions work for non OTel as well, maybe get rid of startChild overloads with startTimestamp and suggest using SpanOptions instead #3498\n- [x] Record dropped spans in `SentrySampler` via client reports #3552\n- [x] Set instrumenter (e.g. using an Aspect) to OTEL from the Java Agent so users don't have to manually do it (now obsolete, due to the agent now taking precedence)\n- [ ] ~~Detect sentry-opentelemetry-agent and set instrumenter automatically even when not using auto config (very similar to above)~~\n\n\u003cdetails>\n \u003csummary>For DACI\u003c/summary>\n\n- [ ] Clarify how OTel can be used directly\n\t- [ ] e.g. to set an attribute: `Span.current().setAttribute(...)` should work for 99% of cases (only if the span isn't made current / bound to scope customers would have to access it differently)\n\t- [ ] describe a way to retrieve the OTel span if it's not the current one\n\t\t- [ ] maybe expose a `getOtelSpan()` on Sentry span but that would drag OTel dependency into Android and hybrid SDKs\n\t\t- [ ] while implementing OTels `Span` interface would be possible we'd be dragging OTel into Android and hybrid SDKs, which we likely don't want\n\t\t- [ ] best approach is likely to simply add `setAttribute` methods that forward to the OTel span\n\t\t\t- [ ] where do these go to for non OTel mode (i.e. `SentryTracer`, `Span`)?\n\n\u003c/details>","author":{"url":"https://github.com/adinauer","@type":"Person","name":"adinauer"},"datePublished":"2024-05-21T08:50:52Z","url":"https://github.com/getsentry/sentry-java/issues/3436"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:f1328a40-b556-4cda-6b9e-c81e3c80ece0 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 95C8:271798:A773CA:E3C22C:6B048354 |
| html-safe-nonce | 8eaa941b324c8ae3c794664f554b1c9cbccc59dc4f602d38e58028aa476f78f5 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5NUM4OjI3MTc5ODpBNzczQ0E6RTNDMjJDOjZCMDQ4MzU0IiwidmlzaXRvcl9pZCI6IjQ5MzI0MDgyNjIwNTU0NjE3MTYiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 9eed34dc8a9646ac4862099f582d8642c5e65fb085f2b0e1377fa3cc851afb84 |
| hovercard-subject-tag | issue:2307739545 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/getsentry/sentry-java/3436/issue_layout |
| twitter:image | https://opengraph.githubassets.com/003fac41212ed253bf41dd236bdd3c2f81f22e3b529cda074ed96b522b4aed82/getsentry/sentry-java/issues/3436 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/003fac41212ed253bf41dd236bdd3c2f81f22e3b529cda074ed96b522b4aed82/getsentry/sentry-java/issues/3436 |
| og:image:alt | We want to use OpenTelemetry for the Sentry Java SDK. It should be possible to use OpenTelemetry API as well as Sentry API and still have both end up in Sentry. Research Issue More details H: Resto... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | adinauer |
| hostname | github.com |
| expected-hostname | github.com |
| None | 1d5c152376e38b7d2e37f3d5179be29a73bee93b85110da28a4eebe1159cdc70 |
| turbo-cache-control | no-preview |
| go-import | github.com/getsentry/sentry-java git https://github.com/getsentry/sentry-java.git |
| octolytics-dimension-user_id | 1396951 |
| octolytics-dimension-user_login | getsentry |
| octolytics-dimension-repository_id | 3368190 |
| octolytics-dimension-repository_nwo | getsentry/sentry-java |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 3368190 |
| octolytics-dimension-repository_network_root_nwo | getsentry/sentry-java |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | f5017e8ff4ea25a8011fcf0f2a0e430c60dc86c8 |
| ui-target | canary-2 |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width