Skip to content

Commit 635226b

Browse files
authored
Merge branch 'main' into rz/feat/replay-capture-surface-views
2 parents b48fc50 + d446e68 commit 635226b

166 files changed

Lines changed: 9261 additions & 562 deletions

File tree

Some content is hidden

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

.cursor/rules/overview_dev.mdc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,15 @@ Use the `fetch_rules` tool to include these rules when working on specific areas
6666
- `SentryMetricsEvent`, `SentryMetricsEvents`
6767
- `SentryOptions.getMetrics()`, `beforeSend` callback
6868

69+
- **`queues`**: Use when working with:
70+
- Sentry Queues product data or messaging span conventions
71+
- Queue tracing spans/transactions (`queue.publish`, `queue.process`)
72+
- `enableQueueTracing` option and `sentry.enable-queue-tracing`
73+
- Kafka instrumentation (`sentry-kafka`, `SentryKafkaProducer`, `SentryKafkaConsumerTracing`)
74+
- Spring Kafka queue auto-instrumentation and `SentryKafkaRecordInterceptor`
75+
- Messaging span data (`messaging.system`, `messaging.destination.name`, receive latency, retry count)
76+
- `sentry-task-enqueued-time` header and distributed trace propagation through queues
77+
6978
- **`continuous_profiling_jvm`**: Use when working with:
7079
- JVM continuous profiling (`sentry-async-profiler` module)
7180
- `IContinuousProfiler`, `JavaContinuousProfiler`
@@ -118,6 +127,7 @@ Use the `fetch_rules` tool to include these rules when working on specific areas
118127
- System test/e2e/sample → `e2e_tests`
119128
- Feature flag/addFeatureFlag/flag evaluation → `feature_flags`
120129
- Metrics/count/distribution/gauge → `metrics`
130+
- Queues/queue tracing/Kafka/Spring Kafka/queue.publish/queue.process/enableQueueTracing/messaging spans → `queues`
121131
- PR/pull request/stacked PR/stack → `pr`
122132
- JVM continuous profiling/async-profiler/JFR/ProfileChunk → `continuous_profiling_jvm`
123133
- Android continuous profiling/AndroidProfiler/frame metrics/method tracing → no dedicated rule yet; inspect the code directly

.cursor/rules/pr.mdc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,3 +258,5 @@ git push
258258
**Never merge into the collection branch.** Syncing only happens between stack PR branches. The collection branch is untouched until the user merges PRs through GitHub.
259259

260260
Prefer merge over rebase — it preserves commit history, doesn't invalidate existing review comments, and avoids the need for force-pushing. Only rebase if explicitly requested.
261+
262+
**Never amend or force-push stack branches.** Do not use `git commit --amend`, `--force`, or `--force-with-lease` on branches that are part of a stack. Amending a pushed commit requires a force-push, which can cause GitHub to auto-merge or auto-close other PRs in the stack. If a commit needs fixing, add a new fixup commit instead.

.cursor/rules/queues.mdc

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
---
2+
alwaysApply: false
3+
description: Sentry Queues module and Java SDK queue tracing
4+
---
5+
# Sentry Queues and Java SDK Queue Tracing
6+
7+
## Product model
8+
9+
Sentry Queues is built from tracing data. SDKs mark queue work with queue-specific span operations and messaging span data so Sentry can identify producers, consumers, destinations, latency, and failures.
10+
11+
The important concepts are:
12+
- `queue.publish`: a span for enqueueing/publishing a message to a queue or topic.
13+
- `queue.process`: a transaction for processing a dequeued message.
14+
- Messaging span data, especially:
15+
- `messaging.system` (for example `kafka`)
16+
- `messaging.destination.name` (queue/topic name)
17+
- `messaging.message.id`
18+
- `messaging.message.retry.count`
19+
- `messaging.message.body.size`
20+
- `messaging.message.envelope.size`
21+
- `messaging.message.receive.latency`
22+
- Distributed tracing headers (`sentry-trace` and `baggage`) link producer-side work to consumer-side processing.
23+
- Queue receive latency is the time a message spent waiting between publish/enqueue and processing. For Java Kafka, this comes from the `sentry-task-enqueued-time` header that the producer writes and the consumer reads.
24+
25+
The Queues UI is not backed by a separate Java event type. The Java SDK contributes data through spans/transactions with the expected operations, trace context, statuses, and messaging attributes.
26+
27+
## Java SDK implementation
28+
29+
Queue tracing is opt-in. `SentryOptions.isEnableQueueTracing()` defaults to `false` and can be enabled with `setEnableQueueTracing(true)` or external config key `enable-queue-tracing` (`sentry.enable-queue-tracing` in Spring Boot). Captured queue spans/transactions still depend on tracing being enabled and sampled.
30+
31+
Kafka support lives in `sentry-kafka`:
32+
- `SentryKafkaProducer.wrap(Producer)` wraps Kafka `Producer.send(...)` calls.
33+
- Creates a `queue.publish` child span when there is an active span.
34+
- Sets `messaging.system=kafka` and `messaging.destination.name=<topic>`.
35+
- Injects `sentry-trace`, `baggage`, and `sentry-task-enqueued-time` headers.
36+
- Still injects tracing/enqueued-time headers when queue tracing is enabled but there is no active span, so background producers can link to consumers.
37+
- Finishes the span from the Kafka callback with `OK` or `INTERNAL_ERROR`.
38+
- `SentryKafkaConsumerTracing.withTracing(record, callback)` is the manual raw-Kafka consumer helper.
39+
- Forks root scopes for the processing lifecycle and makes them current.
40+
- Continues the trace from Kafka headers.
41+
- Starts a `queue.process` transaction bound to scope when tracing is enabled.
42+
- Sets Kafka messaging data, body size, retry count, and receive latency when available.
43+
- Finishes with `OK` or `INTERNAL_ERROR` and never lets instrumentation failures break customer processing.
44+
45+
Spring Kafka support lives in `sentry-spring`, `sentry-spring-jakarta`, and `sentry-spring-7`:
46+
- `SentryKafkaProducerBeanPostProcessor` installs a producer post-processor on `DefaultKafkaProducerFactory` and wraps created producers with `SentryKafkaProducer.wrap(...)`.
47+
- `SentryKafkaConsumerBeanPostProcessor` installs `SentryKafkaRecordInterceptor` on listener container factories.
48+
- `SentryKafkaRecordInterceptor` starts/finishes `queue.process` transactions around listener processing, continues traces from headers, forks scopes for the record lifecycle, and preserves any existing delegate interceptor.
49+
- Spring Boot auto-configuration registers both post-processors only when Spring Kafka and `sentry-kafka` are present and `sentry.enable-queue-tracing=true`.
50+
- Spring Boot queue auto-configuration is disabled when Sentry OpenTelemetry integration classes are present to avoid duplicate Kafka instrumentation.
51+
52+
## Trace origins and suppression
53+
54+
Queue instrumentation sets span origins so it can be identified and suppressed with `ignoredSpanOrigins`:
55+
- Raw Kafka producer: `auto.queue.kafka.producer`
56+
- Raw Kafka consumer helper: `manual.queue.kafka.consumer`
57+
- Spring Kafka producer: `auto.queue.spring.kafka.producer`, `auto.queue.spring_jakarta.kafka.producer`, `auto.queue.spring7.kafka.producer`
58+
- Spring Kafka consumer: `auto.queue.spring.kafka.consumer`, `auto.queue.spring_jakarta.kafka.consumer`, `auto.queue.spring7.kafka.consumer`
59+
60+
## Files to inspect when changing queue tracing
61+
62+
- Core option and conventions:
63+
- `sentry/src/main/java/io/sentry/SentryOptions.java`
64+
- `sentry/src/main/java/io/sentry/ExternalOptions.java`
65+
- `sentry/src/main/java/io/sentry/SpanDataConvention.java`
66+
- Raw Kafka:
67+
- `sentry-kafka/src/main/java/io/sentry/kafka/SentryKafkaProducer.java`
68+
- `sentry-kafka/src/main/java/io/sentry/kafka/SentryKafkaConsumerTracing.java`
69+
- `sentry-kafka/src/test/kotlin/io/sentry/kafka/*Test.kt`
70+
- Spring Kafka:
71+
- `sentry-spring*/src/main/java/io/sentry/**/kafka/*`
72+
- `sentry-spring*/src/test/kotlin/io/sentry/**/kafka/*Test.kt`
73+
- `sentry-spring-boot*/src/main/java/io/sentry/**/SentryAutoConfiguration.java`
74+
- `sentry-spring-boot*/src/test/kotlin/io/sentry/**/SentryKafkaAutoConfigurationTest.kt`
75+
76+
## Related rules
77+
78+
Also fetch:
79+
- `options` when changing `enableQueueTracing` or configuration surfaces.
80+
- `scopes` when changing consumer scope forking/lifecycle.
81+
- `opentelemetry` when changing coexistence with OTel auto-instrumentation.
82+
- `api` when changing public Kafka APIs or option methods.

.github/CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
* @adinauer @romtsn @markushi
1+
* @adinauer @romtsn @markushi @runningcode @0xadam-brown
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: 'Automation: Notify issues for release'
2+
on:
3+
release:
4+
types:
5+
- published
6+
workflow_dispatch:
7+
inputs:
8+
version:
9+
description: Which version to notify issues for
10+
required: true
11+
12+
permissions:
13+
contents: read
14+
issues: write
15+
pull-requests: read
16+
17+
jobs:
18+
release-comment-issues:
19+
runs-on: ubuntu-24.04
20+
name: 'Notify issues'
21+
steps:
22+
- name: Get version
23+
id: get_version
24+
env:
25+
INPUTS_VERSION: ${{ github.event.inputs.version }}
26+
RELEASE_TAG_NAME: ${{ github.event.release.tag_name }}
27+
run: echo "version=${INPUTS_VERSION:-$RELEASE_TAG_NAME}" >> "$GITHUB_OUTPUT"
28+
29+
- name: Comment on linked issues that are mentioned in release
30+
if: |
31+
steps.get_version.outputs.version != ''
32+
&& !contains(steps.get_version.outputs.version, '-beta.')
33+
&& !contains(steps.get_version.outputs.version, '-alpha.')
34+
&& !contains(steps.get_version.outputs.version, '-rc.')
35+
36+
uses: getsentry/release-comment-issues-gh-action@v1
37+
with:
38+
github_token: ${{ secrets.GITHUB_TOKEN }}
39+
version: ${{ steps.get_version.outputs.version }}

AGENTS.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,17 @@ 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+
### Third-Party Code Attribution
148+
When adapting code from third-party libraries:
149+
1. Add a license header at the top of the adapted file (before the `package` statement):
150+
```java
151+
// Adapted from <Library Name>.
152+
// Copyright <year> <copyright holder>.
153+
// Licensed under the <License Name>.
154+
// <source URL>
155+
```
156+
2. Add a full attribution entry to `THIRD_PARTY_NOTICES.md` following the existing format (Source, License, Copyright, Scope, full license text)
157+
147158
### Getting PR Information
148159

149160
Use `gh pr view` to get PR details from the current branch. This is needed when adding changelog entries, which require the PR number.

CHANGELOG.md

Lines changed: 41 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,54 @@
44

55
### Features
66

7+
<<<<<<< rz/feat/replay-capture-surface-views
78
- Session Replay: experimental support for capturing `SurfaceView` content (e.g. Unity, video players, maps) ([#5333](https://github.com/getsentry/sentry-java/pull/5333))
89
- To enable, set `options.sessionReplay.isCaptureSurfaceViews = true`
910
- Or via manifest: `<meta-data android:name="io.sentry.session-replay.capture-surface-views" android:value="true" />`
1011
- **Warning:** masking granularity is at the SurfaceView level only — the SDK cannot mask individual elements rendered inside the SurfaceView (e.g. native Unity UI, map labels, video frames). Only enable for SurfaceViews whose content is safe to record.
12+
=======
13+
- Add `Sentry.feedback()` API for `show()` and `capture()` ([#5349](https://github.com/getsentry/sentry-java/pull/5349))
14+
- `Sentry.showUserFeedbackDialog()` is deprecated in favor of `Sentry.feedback().show()`
15+
- `Sentry.captureFeedback()` is deprecated in favor of `Sentry.feedback().capture()`
16+
- `Sentry.captureUserFeedback()` and `UserFeedback` are deprecated in favor of `Sentry.feedback().capture()` with the new `Feedback` type
17+
- `SentryUserFeedbackDialog` is deprecated in favor of `SentryUserFeedbackForm`
18+
- All deprecated APIs will be removed in the next major version
19+
- Deprecate `SentryUserFeedbackButton` (View-based and Compose-based) ([#5350](https://github.com/getsentry/sentry-java/pull/5350))
20+
- It will be removed in the next major version
21+
- Add per-form shake-to-show support for `SentryUserFeedbackForm` ([#5353](https://github.com/getsentry/sentry-java/pull/5353))
22+
- Useful for enabling shake-to-report on specific screens instead of globally
23+
```kotlin
24+
SentryUserFeedbackForm.Builder(activity)
25+
.configurator { it.isUseShakeGesture = true }
26+
.create()
27+
```
28+
- Add support for Kafka ([#5249](https://github.com/getsentry/sentry-java/pull/5249))
29+
- You will need to add the `sentry-kafka` dependency and opt-in via the new option.
30+
- Set `options.setEnableQueueTracing(true)` on `Sentry.init`
31+
- Or set `sentry.enable-queue-tracing=true` in `application.properties`
32+
- For Spring Boot Kafka is auto instrumented and no further configuration is needed.
33+
- also see https://docs.sentry.io/platforms/java/guides/spring-boot/integrations/kafka/
34+
- When using `kafka-clients` directly
35+
- you need to wrap your `KafkaProducer` via `SentryKafkaProducer.wrap(kafkaProducer)` to get `queue.publish` spans
36+
- and you may use our `SentryKafkaConsumerTracing.withTracing` helper to instrument the consumer side manually.
37+
- also see https://docs.sentry.io/platforms/java/integrations/kafka/
38+
39+
### Fixes
40+
41+
- Fix soft input keyboard not being shown on the Feedback form ([#5359](https://github.com/getsentry/sentry-java/pull/5359))
42+
- Fix shake-to-report not triggering on some devices due to high acceleration threshold ([#5366](https://github.com/getsentry/sentry-java/pull/5366))
43+
- Fix feedback form retaining previous message when shown again via shake ([#5366](https://github.com/getsentry/sentry-java/pull/5366))
44+
- Avoid stack overflow when deserializing large flat JSON objects ([#5361](https://github.com/getsentry/sentry-java/pull/5361))
45+
>>>>>>> main
1146

1247
### Dependencies
1348

14-
- Bump Native SDK from v0.13.7 to v0.13.8 ([#5334](https://github.com/getsentry/sentry-java/pull/5334))
15-
- [changelog](https://github.com/getsentry/sentry-native/blob/master/CHANGELOG.md#0138)
16-
- [diff](https://github.com/getsentry/sentry-native/compare/0.13.7...0.13.8)
49+
- Bump Native SDK from v0.13.7 to v0.14.0 ([#5334](https://github.com/getsentry/sentry-java/pull/5334), [#5365](https://github.com/getsentry/sentry-java/pull/5365))
50+
- [changelog](https://github.com/getsentry/sentry-native/blob/master/CHANGELOG.md#0140)
51+
- [diff](https://github.com/getsentry/sentry-native/compare/0.13.7...0.14.0)
52+
- Bump Gradle from v9.4.1 to v9.5.0 ([#5344](https://github.com/getsentry/sentry-java/pull/5344))
53+
- [changelog](https://github.com/gradle/gradle/blob/master/CHANGELOG.md#v950)
54+
- [diff](https://github.com/gradle/gradle/compare/v9.4.1...v9.5.0)
1755

1856
## 8.40.0
1957

CONTRIBUTING.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,13 @@ or
5757

5858
However, if your change did not intend to modify the public API, consider changing the method/property visibility or removing the change altogether.
5959

60+
# Linking issues
61+
62+
If a PR should notify a linked issue after release, use a GitHub closing keyword in the PR
63+
description, such as `Fixes #123`, `Closes #123`, or `Resolves #123`. Release notification
64+
automation only comments on issues GitHub recognizes as closed by the released PR; mentioning an
65+
issue without a closing keyword is not enough.
66+
6067
# CI
6168

6269
Build and tests are automatically run against branches and pull requests

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ Sentry SDK for Java and Android
3535
| sentry | [![Maven Central Version](https://img.shields.io/maven-central/v/io.sentry/sentry?style=for-the-badge&logo=sentry&color=green)](https://central.sonatype.com/artifact/io.sentry/sentry) | 21 |
3636
| sentry-jul | [![Maven Central Version](https://img.shields.io/maven-central/v/io.sentry/sentry-jul?style=for-the-badge&logo=sentry&color=green)](https://central.sonatype.com/artifact/io.sentry/sentry-jul) |
3737
| sentry-jdbc | [![Maven Central Version](https://img.shields.io/maven-central/v/io.sentry/sentry-jdbc?style=for-the-badge&logo=sentry&color=green)](https://central.sonatype.com/artifact/io.sentry/sentry-jdbc) |
38+
| sentry-kafka | [![Maven Central Version](https://img.shields.io/maven-central/v/io.sentry/sentry-kafka?style=for-the-badge&logo=sentry&color=green)](https://central.sonatype.com/artifact/io.sentry/sentry-kafka) |
3839
| sentry-apollo | [![Maven Central Version](https://img.shields.io/maven-central/v/io.sentry/sentry-apollo?style=for-the-badge&logo=sentry&color=green)](https://central.sonatype.com/artifact/io.sentry/sentry-apollo) | 21 |
3940
| sentry-apollo-3 | [![Maven Central Version](https://img.shields.io/maven-central/v/io.sentry/sentry-apollo-3?style=for-the-badge&logo=sentry&color=green)](https://central.sonatype.com/artifact/io.sentry/sentry-apollo-3) | 21 |
4041
| sentry-apollo-4 | [![Maven Central Version](https://img.shields.io/maven-central/v/io.sentry/sentry-apollo-4?style=for-the-badge&logo=sentry&color=green)](https://central.sonatype.com/artifact/io.sentry/sentry-apollo-4) | 21 |

THIRD_PARTY_NOTICES.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,34 @@ limitations under the License.
118118

119119
---
120120

121+
## Square — Seismic (Apache 2.0)
122+
123+
**Source:** https://github.com/square/seismic<br>
124+
**License:** Apache License 2.0<br>
125+
**Copyright:** Copyright 2010 Square, Inc.
126+
127+
### Scope
128+
129+
The Sentry Java SDK includes an adapted version of Square's Seismic shake detection algorithm. The rolling sample window approach and `SampleQueue`/`SamplePool` data structures in `io.sentry.android.core.SentryShakeDetector` are based on Seismic's `ShakeDetector`.
130+
131+
```
132+
Copyright 2010 Square, Inc.
133+
134+
Licensed under the Apache License, Version 2.0 (the "License");
135+
you may not use this file except in compliance with the License.
136+
You may obtain a copy of the License at
137+
138+
http://www.apache.org/licenses/LICENSE-2.0
139+
140+
Unless required by applicable law or agreed to in writing, software
141+
distributed under the License is distributed on an "AS IS" BASIS,
142+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
143+
See the License for the specific language governing permissions and
144+
limitations under the License.
145+
```
146+
147+
---
148+
121149
## Square — Curtains (Apache 2.0)
122150

123151
**Source:** https://github.com/square/curtains (v1.2.5)<br>

0 commit comments

Comments
 (0)