Skip to content

Commit 143e887

Browse files
committed
Merge branch 'main' into feat/create-java-pr-skill
2 parents 0c7de2c + 6c03ee9 commit 143e887

File tree

96 files changed

+4462
-299
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

96 files changed

+4462
-299
lines changed

.craft.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ targets:
4848
maven:io.sentry:sentry-opentelemetry-agentless-spring:
4949
maven:io.sentry:sentry-opentelemetry-bootstrap:
5050
maven:io.sentry:sentry-opentelemetry-core:
51+
# maven:io.sentry:sentry-opentelemetry-otlp:
52+
# maven:io.sentry:sentry-opentelemetry-otlp-spring:
5153
maven:io.sentry:sentry-apollo:
5254
maven:io.sentry:sentry-jdbc:
5355
maven:io.sentry:sentry-graphql:

.cursor/rules/opentelemetry.mdc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ The Sentry Java SDK provides comprehensive OpenTelemetry integration through mul
1414
- `sentry-opentelemetry-agentless-spring`: Spring-specific agentless integration
1515
- `sentry-opentelemetry-bootstrap`: Classes that go into the bootstrap classloader when the agent is used. For agentless they are simply used in the applications classloader.
1616
- `sentry-opentelemetry-agentcustomization`: Classes that help wire up Sentry in OpenTelemetry. These land in the agent classloader when the agent is used. For agentless they are simply used in the application classloader.
17+
- `sentry-opentelemetry-otlp`: Classes for using OpenTelemetry to send spans to Sentry using the OTLP endpoint and have Sentry use OpenTelemetry trace and span id.
18+
- `sentry-opentelemetry-otlp-spring`: Spring Boot convenience module that includes `sentry-opentelemetry-otlp` and the OpenTelemetry Spring Boot starter as transitive dependencies.
1719

1820
## Advantages over using Sentry without OpenTelemetry
1921

@@ -86,3 +88,10 @@ After creating the transaction with child spans `SentrySpanExporter` uses Sentry
8688
## Troubleshooting
8789

8890
To debug forking of `Scopes`, we added a reference to `parent` `Scopes` and a `creator` String to store the reason why `Scopes` were created or forked.
91+
92+
# OTLP
93+
When using `sentry-opentelemetry-otlp`, Sentry only loads trace ID and span ID from OpenTelemetry `Context` (via `OpenTelemetryOtlpEventProcessor`). Sentry does not rely on OpenTelemetry `Context` for scope storage and propagation, instead relying on its `DefaultScopesStorage`.
94+
It is common to keep Performance in Sentry SDK disabled since that part is taken over by OpenTelemetry.
95+
The `sentry-opentelemetry-otlp` module is not connected to the other `sentry-opentelemetry-*` modules but instead intended only when the goal is to run OpenTelemetry for creating spans and Sentry for other products like errors, logs, metrics etc.
96+
The `sentry-opentelemetry-otlp-spring` module wraps `sentry-opentelemetry-otlp` and includes the OpenTelemetry Spring Boot starter for easier setup in Spring Boot applications.
97+
The OTLP module does not easily work with the OpenTelemetry agent as it would require customizing the agent.JAR in order to get the propagator loaded.

.github/workflows/system-tests-backend.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ jobs:
5454
- sample: "sentry-samples-console"
5555
agent: "false"
5656
agent-auto-init: "true"
57+
- sample: "sentry-samples-console-otlp"
58+
agent: "false"
59+
agent-auto-init: "true"
5760
- sample: "sentry-samples-logback"
5861
agent: "false"
5962
agent-auto-init: "true"
@@ -78,6 +81,9 @@ jobs:
7881
- sample: "sentry-samples-spring-boot-4-opentelemetry"
7982
agent: "true"
8083
agent-auto-init: "false"
84+
- sample: "sentry-samples-spring-boot-4-otlp"
85+
agent: "false"
86+
agent-auto-init: "true"
8187
- sample: "sentry-samples-spring-7"
8288
agent: "false"
8389
agent-auto-init: "true"

AGENTS.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,21 @@ The repository is organized into multiple modules:
144144
4. New features must be **opt-in by default** - extend `SentryOptions` or similar Option classes with getters/setters
145145
5. Consider backwards compatibility
146146

147+
### Getting PR Information
148+
149+
Use `gh pr view` to get PR details from the current branch. This is needed when adding changelog entries, which require the PR number.
150+
151+
```bash
152+
# Get PR number for current branch
153+
gh pr view --json number -q '.number'
154+
155+
# Get PR number for a specific branch
156+
gh pr view <branch-name> --json number -q '.number'
157+
158+
# Get PR URL
159+
gh pr view --json url -q '.url'
160+
```
161+
147162
## Useful Resources
148163

149164
- Main SDK documentation: https://develop.sentry.dev/sdk/overview/

CHANGELOG.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,32 @@
22

33
## Unreleased
44

5+
### Features
6+
7+
- Create `sentry-opentelemetry-otlp` and `sentry-opentelemetry-otlp-spring` modules for combining OpenTelemetry SDK OTLP export with Sentry SDK ([#5100](https://github.com/getsentry/sentry-java/pull/5100))
8+
- OpenTelemetry is configured to send spans to Sentry directly using an OTLP endpoint.
9+
- Sentry only uses trace and span ID from OpenTelemetry (via `OpenTelemetryOtlpEventProcessor`) but will not send spans through OpenTelemetry nor use OpenTelemetry `Context` for `Scopes` propagation.
10+
- See the OTLP setup docs for [Java](https://docs.sentry.io/platforms/java/opentelemetry/setup/otlp/) and [Spring Boot](https://docs.sentry.io/platforms/java/guides/spring-boot/opentelemetry/setup/otlp/) for installation and configuration instructions.
11+
- Add screenshot masking support using view hierarchy ([#5077](https://github.com/getsentry/sentry-java/pull/5077))
12+
- Masks sensitive content (text, images) in error screenshots using the same view hierarchy approach as Session Replay
13+
- Requires the `sentry-android-replay` module to be present at runtime for masking to work
14+
- Enable via code:
15+
```kotlin
16+
SentryAndroid.init(context) { options ->
17+
options.isAttachScreenshot = true
18+
options.screenshot.setMaskAllText(true)
19+
options.screenshot.setMaskAllImages(true)
20+
// Or mask specific view classes
21+
options.screenshot.addMaskViewClass("com.example.MyCustomView")
22+
}
23+
```
24+
- Or via `AndroidManifest.xml`:
25+
```xml
26+
<meta-data android:name="io.sentry.attach-screenshot" android:value="true" />
27+
<meta-data android:name="io.sentry.screenshot.mask-all-text" android:value="true" />
28+
<meta-data android:name="io.sentry.screenshot.mask-all-images" android:value="true" />
29+
```
30+
531
### Fixes
632

733
- Fix crash when unregistering `SystemEventsBroadcastReceiver` with try-catch block. ([#5106](https://github.com/getsentry/sentry-java/pull/5106))

CLAUDE.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,4 @@
33
## STOP — Required Reading (Do This First)
44

55
Before doing ANYTHING else (including answering questions), you MUST use the Read tool to load [AGENTS.md](AGENTS.md) and follow ALL of its instructions, including reading the required `.cursor/rules/*.mdc` files it references.
6-
76
Do NOT skip this step. Do NOT proceed without reading these files first.

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ Sentry SDK for Java and Android
6565
| sentry-opentelemetry-agent | ![Maven Central Version](https://img.shields.io/maven-central/v/io.sentry/sentry-opentelemetry-agent?style=for-the-badge&logo=sentry&color=green) |
6666
| sentry-opentelemetry-agentcustomization | ![Maven Central Version](https://img.shields.io/maven-central/v/io.sentry/sentry-opentelemetry-agentcustomization?style=for-the-badge&logo=sentry&color=green) |
6767
| sentry-opentelemetry-core | ![Maven Central Version](https://img.shields.io/maven-central/v/io.sentry/sentry-opentelemetry-core?style=for-the-badge&logo=sentry&color=green) |
68+
| sentry-opentelemetry-otlp | ![Maven Central Version](https://img.shields.io/maven-central/v/io.sentry/sentry-opentelemetry-otlp?style=for-the-badge&logo=sentry&color=green) |
69+
| sentry-opentelemetry-otlp-spring | ![Maven Central Version](https://img.shields.io/maven-central/v/io.sentry/sentry-opentelemetry-otlp-spring?style=for-the-badge&logo=sentry&color=green) |
6870
| sentry-okhttp | ![Maven Central Version](https://img.shields.io/maven-central/v/io.sentry/sentry-okhttp?style=for-the-badge&logo=sentry&color=green) |
6971
| sentry-reactor | ![Maven Central Version](https://img.shields.io/maven-central/v/io.sentry/sentry-reactor?style=for-the-badge&logo=sentry&color=green) |
7072
| sentry-spotlight | ![Maven Central Version](https://img.shields.io/maven-central/v/io.sentry/sentry-spotlight?style=for-the-badge&logo=sentry&color=green) |

build.gradle.kts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ apiValidation {
7777
"sentry-samples-spring-boot-4",
7878
"sentry-samples-spring-boot-4-opentelemetry",
7979
"sentry-samples-spring-boot-4-opentelemetry-noagent",
80+
"sentry-samples-spring-boot-4-otlp",
8081
"sentry-samples-spring-boot-4-webflux",
8182
"sentry-samples-ktor-client",
8283
"sentry-uitest-android",
@@ -85,7 +86,8 @@ apiValidation {
8586
"test-app-plain",
8687
"test-app-sentry",
8788
"test-app-size",
88-
"sentry-samples-netflix-dgs"
89+
"sentry-samples-netflix-dgs",
90+
"sentry-samples-console-otlp"
8991
)
9092
)
9193
}

buildSrc/src/main/java/Config.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ object Config {
6464
val SENTRY_SPRING_BOOT_4_STARTER_SDK_NAME = "$SENTRY_JAVA_SDK_NAME.spring-boot-4-starter"
6565
val SENTRY_OPENTELEMETRY_BOOTSTRAP_SDK_NAME = "$SENTRY_JAVA_SDK_NAME.opentelemetry.bootstrap"
6666
val SENTRY_OPENTELEMETRY_CORE_SDK_NAME = "$SENTRY_JAVA_SDK_NAME.opentelemetry.core"
67+
val SENTRY_OPENTELEMETRY_OTLP_SDK_NAME = "$SENTRY_JAVA_SDK_NAME.opentelemetry.otlp"
68+
val SENTRY_OPENTELEMETRY_OTLP_SPRING_SDK_NAME = "$SENTRY_JAVA_SDK_NAME.opentelemetry.otlp-spring"
6769
val SENTRY_OPENTELEMETRY_AGENT_SDK_NAME = "$SENTRY_JAVA_SDK_NAME.opentelemetry.agent"
6870
val SENTRY_OPENTELEMETRY_AGENTLESS_SDK_NAME = "$SENTRY_JAVA_SDK_NAME.opentelemetry.agentless"
6971
val SENTRY_OPENTELEMETRY_AGENTLESS_SPRING_SDK_NAME = "$SENTRY_JAVA_SDK_NAME.opentelemetry.agentless-spring"

gradle/libs.versions.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,8 @@ okhttp = { module = "com.squareup.okhttp3:okhttp", version.ref = "okhttp" }
134134
okhttp-bom = { module = "com.squareup.okhttp3:okhttp-bom", version.ref = "okhttp" }
135135
openfeature = { module = "dev.openfeature:sdk", version.ref = "openfeature" }
136136
otel = { module = "io.opentelemetry:opentelemetry-sdk", version.ref = "otel" }
137+
otel-exporter-otlp = { module = "io.opentelemetry:opentelemetry-exporter-otlp", version.ref = "otel" }
138+
otel-exporter-logging = { module = "io.opentelemetry:opentelemetry-exporter-logging", version.ref = "otel" }
137139
otel-extension-autoconfigure = { module = "io.opentelemetry:opentelemetry-sdk-extension-autoconfigure", version.ref = "otel" }
138140
otel-extension-autoconfigure-spi = { module = "io.opentelemetry:opentelemetry-sdk-extension-autoconfigure-spi", version.ref = "otel" }
139141
otel-instrumentation-bom = { module = "io.opentelemetry.instrumentation:opentelemetry-instrumentation-bom", version.ref = "otelInstrumentation" }
@@ -236,3 +238,4 @@ msgpack = { module = "org.msgpack:msgpack-core", version = "0.9.8" }
236238
okhttp-mockwebserver = { module = "com.squareup.okhttp3:mockwebserver", version.ref = "okhttp" }
237239
okio = { module = "com.squareup.okio:okio", version = "1.13.0" }
238240
roboelectric = { module = "org.robolectric:robolectric", version = "4.14" }
241+
dropbox-differ = { module = "com.dropbox.differ:differ-jvm", version = "0.3.0" }

0 commit comments

Comments
 (0)