Title: Java SDK basic OTEL Support · Issue #2327 · getsentry/sentry-java · GitHub
Open Graph Title: Java SDK basic OTEL Support · Issue #2327 · getsentry/sentry-java
X Title: Java SDK basic OTEL Support · Issue #2327 · getsentry/sentry-java
Description: Description More details tbd Our plan is to create a SpanProcessor (for sending spans to Sentry) as well as probably a TextMapPropagator (for dealing with tracing across systems). We'll probably also need to provide an agent JAR for peop...
Open Graph Description: Description More details tbd Our plan is to create a SpanProcessor (for sending spans to Sentry) as well as probably a TextMapPropagator (for dealing with tracing across systems). We'll probably al...
X Description: Description More details tbd Our plan is to create a SpanProcessor (for sending spans to Sentry) as well as probably a TextMapPropagator (for dealing with tracing across systems). We'll probabl...
Opengraph URL: https://github.com/getsentry/sentry-java/issues/2327
X: @github
Domain: github.com
IPv4 address: 140.82.113.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Java SDK basic OTEL Support","articleBody":"### Description\r\n\r\nMore details tbd\r\n\r\nOur plan is to create a `SpanProcessor` (for sending spans to Sentry) as well as probably a `TextMapPropagator` (for dealing with tracing across systems).\r\n\r\nWe'll probably also need to provide an agent `JAR` for people to auto instrument their applications.\r\n\r\nThere may be problems with initializing Sentry in combination with the agent, needs investigation.\r\n\r\nImplementing it should address https://github.com/getsentry/sentry-java/issues/1348 .\r\n\r\nHere's issues on other SDKs implementing OTEL support:\r\n- https://github.com/getsentry/sentry-ruby/issues/1907\r\n- https://github.com/getsentry/sentry-python/issues/1687\r\n- https://github.com/getsentry/sentry-javascript/issues/6000\r\n- https://github.com/getsentry/sentry-go/issues/486\r\n\r\n## Challenges faced\r\n\r\n### Accessing the initialized `Sentry` instance of the target application from the OTEL Java Agent\r\n\r\nAsked on [OTEL GH](https://github.com/open-telemetry/opentelemetry-java-instrumentation/discussions/7042) and got some suggestions:\r\n\r\n#### Use reflection\r\nThis would require us to perform every interaction with Sentry using reflection, not just retrieving the instance but every invocation which would lead to very difficult maintenance and brittle code\r\n\r\n#### Add `Sentry` to the bootstrap classloader\r\nso the same instance can be accessed from the target application and the OTEL Java Agent: This requires us to create our own custom distro of the OTEL Java Agent as shown in [their samples](https://github.com/open-telemetry/opentelemetry-java-instrumentation/tree/main/examples/distro). We first tried producing an agent JAR with `SpanProcessor` added as extension but that didn't allow us to add to the bootstrap classloader.\r\n\r\n## TODOs\r\n\r\n- [x] [Merge feature into `main`](https://github.com/getsentry/sentry-java/pull/2344)\r\n- [x] Release\r\n- [x] [Document](https://github.com/getsentry/sentry-docs/pull/5968)\r\n- [x] [Create new modules for OTEL](https://github.com/getsentry/sentry-java/pull/2345)\r\n- [x] Add new modules to release registry\r\n- [x] [Add `instrumenter` to options and make `startTransaction` and `createChild` no-op if the `instrumenter` performing the operation does not match the configured one.](https://github.com/getsentry/sentry-java/pull/2349)\r\n- [x] Implement [`SpanProcessor`](https://github.com/getsentry/sentry-java/pull/2357)\r\n- [x] [Add otel to context](https://github.com/getsentry/sentry-java/pull/2361)\r\n- [x] [Implement `TextMapPropagator`](https://github.com/getsentry/sentry-java/pull/2380)\r\n- [x] [Allow configuring Sentry when only using the Java Agent so it's not needed in the target application](https://github.com/getsentry/sentry-java/pull/2386)\r\n- [x] [Make sure `null` classloader (i.e. bootstrap classloader) doesn't cause issues](https://github.com/getsentry/sentry-java/pull/2386)\r\n- [x] https://github.com/getsentry/sentry-java/issues/2376\r\n- [x] [Add logging to `SentrySpanProcessor`, `SentryPropagator` etc.](https://github.com/getsentry/sentry-java/pull/2425)\r\n- [x] [Add Sentry OTEL Java Agent](https://github.com/getsentry/opentelemetry-demo/pull/15) to OTEL demo\r\n- [x] [Upgrade to latest OTEL release(s)](https://github.com/getsentry/sentry-java/pull/2420)\r\n- [x] [Add automated tests for OTEL](https://github.com/getsentry/sentry-java/pull/2401)\r\n- [x] Add README to `sentry-opentelemetry` modules\r\n- [x] Use `HubAdapter` instead of `Sentry`\r\n- [x] [Do not override default exporter config but rather document how to get rid of log spam if only using Sentry without OTEL exporter](https://github.com/getsentry/sentry-java/pull/2408)\r\n- [x] [Link errors to transactions created via OTEL](https://github.com/getsentry/sentry-java/pull/2418)\r\n- [x] [Make it possible to disable auto init in Java Agent so the target application can still use ENV vars and properties file for init without triggering auto init](https://github.com/getsentry/sentry-java/pull/2410)\r\n","author":{"url":"https://github.com/adinauer","@type":"Person","name":"adinauer"},"datePublished":"2022-11-02T13:46:18Z","url":"https://github.com/getsentry/sentry-java/issues/2327"}
| 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:ed479181-59fe-1898-1181-ae644057fae2 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E35E:20A7C6:47C501:5F2FCF:6B04D9D3 |
| html-safe-nonce | fec965db459d4cb908746f060772b1405e804e4c669ddd4543eb30ad2994cccb |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMzVFOjIwQTdDNjo0N0M1MDE6NUYyRkNGOjZCMDREOUQzIiwidmlzaXRvcl9pZCI6IjgyNjc4Njg1OTg0Mjk4NjY0NTEiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | d3d2b17d76b5928c360055f939f8c8b3b41f960b8c51687908d64e8a1a6b7251 |
| hovercard-subject-tag | issue:1433176281 |
| 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/2327/issue_layout |
| twitter:image | https://opengraph.githubassets.com/7a7b20d82d5c7763351b0f414c0f1b5b0e8337694b7177304b1ef22a259f910f/getsentry/sentry-java/issues/2327 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/7a7b20d82d5c7763351b0f414c0f1b5b0e8337694b7177304b1ef22a259f910f/getsentry/sentry-java/issues/2327 |
| og:image:alt | Description More details tbd Our plan is to create a SpanProcessor (for sending spans to Sentry) as well as probably a TextMapPropagator (for dealing with tracing across systems). We'll probably al... |
| 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 | 194dacb8acfd3e4d3ffb2704e0b1f10327f0dad690a7142acc7b0e0a2d073965 |
| 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 | 6c35540a0a2991ee20bd053ba2601cce33f72cb1 |
| ui-target | full |
| 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