sentry-java / rules
Cursor rule1.4k starsChanged 7 months agoMITView on GitHub
Sentry Queues module and Java SDK queue tracing
Trending
Quiet this year.about the whole repository
Who's talking about getsentry/sentry-java
- getsentry/sentry“[Mobile Replay] Capture Network request/response bodies”GitHub · Feb 5, 2025 · 48 reactions
- quarkusio/quarkus“Sentry tracing with automatic instrumentation”GitHub · Aug 31, 2021 · 19 reactions
- getsentry/sentry-dart“Support Source Context”GitHub · Oct 25, 2020 · 18 reactions
- getsentry/sentry-dotnet“OpenTelemetry Support”GitHub · Nov 25, 2022 · 11 reactions
- getsentry/sentry-dotnet“Feature: Session Replay support for .NET MAUI”GitHub · Jan 30, 2023 · 8 reactions
The biggest 5 of 18 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 18
Talked about on GitHub (18 times).
On GitHub · 18
- Feb 5, 2025[Mobile Replay] Capture Network request/response bodies — getsentry/sentry48 reactions · 13 comments
- Aug 31, 2021Sentry tracing with automatic instrumentation — quarkusio/quarkus19 reactions · 20 comments
- Oct 25, 2020Support Source Context — getsentry/sentry-dart18 reactions · 24 comments
- Nov 25, 2022OpenTelemetry Support — getsentry/sentry-dotnet11 reactions · 4 comments
- Jan 30, 2023Feature: Session Replay support for .NET MAUI — getsentry/sentry-dotnet8 reactions · 9 comments
13 more on GitHub
- Mar 19, 2025Add UI Profiling Support (converted to project) — getsentry/sentry-react-native5 reactions · 3 comments
- Jan 20, 2021Proposal (Performance): Some convenience API to wrap a Promise with a Span/Transaction — getsentry/sentry-javascript5 reactions · 2 comments
- May 1, 2025feat: Initial Android support — getsentry/sentry-godot4 reactions · 3 comments
- Mar 25, 2024feat(replay): Add Mobile Replay Alpha — getsentry/sentry-react-native4 reactions · 8 comments
- Feb 8, 2023Add support for Sentry — spring-io/start.spring.io4 reactions · 6 comments
- May 4, 2022Figure out how to implement hints — getsentry/sentry-javascript4 reactions · 5 comments
- Dec 10, 2020Add basic support for attachments — getsentry/sentry-cocoa4 reactions
- Jul 17, 2025Bump io.sentry.android.gradle from 4.10.0 to 5.8.0 — woocommerce/woocommerce-android3 reactions · 2 comments
- Jul 23, 2024feat: User Feedback widget/form — getsentry/sentry-cocoa3 reactions · 5 comments
- May 1, 2024Remove `enableTracing` (and update docs accordingly) — getsentry/team-sdks3 reactions · 7 comments
- Feb 1, 2024[Epic] Mobile Session Replay — getsentry/sentry3 reactions · 2 comments
- Nov 20, 2023Tracing: W3C Trace Context Support — getsentry/team-sdks3 reactions · 9 comments
- Jan 12, 2023Allow more granular auto installation — getsentry/sentry-android-gradle-plugin3 reactions · 3 comments
In this repository17 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .cursor/rules/api.mdcCursor rule
- .cursor/rules/continuous_profiling_jvm.mdcCursor rule
- .cursor/rules/deduplication.mdcCursor rule
- .cursor/rules/e2e_tests.mdcCursor rule
- .cursor/rules/feature_flags.mdcCursor rule
- .cursor/rules/metrics.mdcCursor rule
- .cursor/rules/new_module.mdcCursor rule
- .cursor/rules/offline.mdcCursor rule
- .cursor/rules/opentelemetry.mdcCursor rule
- .cursor/rules/options.mdcCursor rule
- .cursor/rules/scopes.mdcCursor rule
- btrace-perfettoSkill
- check-code-attributionSkill
- create-java-prSkill
- testSkill
The file
Files
--- alwaysApply: false description: Sentry Queues module and Java SDK queue tracing --- # Sentry Queues and Java SDK Queue Tracing ## Product model 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. The important concepts are: - `queue.publish`: a span for enqueueing/publishing a message to a queue or topic. - `queue.process`: a transaction for processing a dequeued message. - Messaging span data, especially: - `messaging.system` (for example `kafka`) - `messaging.destination.name` (queue/topic name) - `messaging.message.id` - `messaging.message.retry.count` - `messaging.message.body.size` - `messaging.message.envelope.size` - `messaging.message.receive.latency` - Distributed tracing headers (`sentry-trace` and `baggage`) link producer-side work to consumer-side processing. - 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. 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. ## Java SDK implementation 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. Kafka support lives in `sentry-kafka`: - `SentryKafkaProducer.wrap(Producer)` wraps Kafka `Producer.send(...)` calls. - Creates a `queue.publish` child span when there is an active span. - Sets `messaging.system=kafka` and `messaging.destination.name=<topic>`. - Injects `sentry-trace`, `baggage`, and `sentry-task-enqueued-time` headers. - Still injects tracing/enqueued-time headers when queue tracing is enabled but there is no active span, so background producers can link to consumers. - Finishes the span from the Kafka callback with `OK` or `INTERNAL_ERROR`. - `SentryKafkaConsumerTracing.withTracing(record, callback)` is the manual raw-Kafka consumer helper. - Forks root scopes for the processing lifecycle and makes them current. - Continues the trace from Kafka headers. - Starts a `queue.process` transaction bound to scope when tracing is enabled. - Sets Kafka messaging data, body size, retry count, and receive latency when available. - Finishes with `OK` or `INTERNAL_ERROR` and never lets instrumentation failures break customer processing. Spring Kafka support lives in `sentry-spring`, `sentry-spring-jakarta`, and `sentry-spring-7`: - `SentryKafkaProducerBeanPostProcessor` installs a producer post-processor on `DefaultKafkaProducerFactory` and wraps created producers with `SentryKafkaProducer.wrap(...)`. - `SentryKafkaConsumerBeanPostProcessor` installs `SentryKafkaRecordInterceptor` on listener container factories. - `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. - Spring Boot auto-configuration registers both post-processors only when Spring Kafka and `sentry-kafka` are present and `sentry.enable-queue-tracing=true`. - Spring Boot queue auto-configuration is disabled when Sentry OpenTelemetry integration classes are present to avoid duplicate Kafka instrumentation. ## Trace origins and suppression Queue instrumentation sets span origins so it can be identified and suppressed with `ignoredSpanOrigins`: - Raw Kafka producer: `auto.queue.kafka.producer` - Raw Kafka consumer helper: `manual.queue.kafka.consumer` - Spring Kafka producer: `auto.queue.spring.kafka.producer`, `auto.queue.spring_jakarta.kafka.producer`, `auto.queue.spring7.kafka.producer` - Spring Kafka consumer: `auto.queue.spring.kafka.consumer`, `auto.queue.spring_jakarta.kafka.consumer`, `auto.queue.spring7.kafka.consumer` ## Files to inspect when changing queue tracing - Core option and conventions: - `sentry/src/main/java/io/sentry/SentryOptions.java` - `sentry/src/main/java/io/sentry/ExternalOptions.java` - `sentry/src/main/java/io/sentry/SpanDataConvention.java` - Raw Kafka: - `sentry-kafka/src/main/java/io/sentry/kafka/SentryKafkaProducer.java` - `sentry-kafka/src/main/java/io/sentry/kafka/SentryKafkaConsumerTracing.java` - `sentry-kafka/src/test/kotlin/io/sentry/kafka/*Test.kt` - Spring Kafka: - `sentry-spring*/src/main/java/io/sentry/**/kafka/*` - `sentry-spring*/src/test/kotlin/io/sentry/**/kafka/*Test.kt` - `sentry-spring-boot*/src/main/java/io/sentry/**/SentryAutoConfiguration.java` - `sentry-spring-boot*/src/test/kotlin/io/sentry/**/SentryKafkaAutoConfigurationTest.kt` ## Related rules Also fetch: - `options` when changing `enableQueueTracing` or configuration surfaces. - `scopes` when changing consumer scope forking/lifecycle. - `opentelemetry` when changing coexistence with OTel auto-instrumentation. - `api` when changing public Kafka APIs or option methods.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

