sentry-java / rules
Cursor rule1.4k starsChanged 7 months agoMITView on GitHub
Public API surface, binary compatibility, and common classes to modify
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
Where files are headingNew Cursor rule files have more rules about planning and tracking tasks, and fewer about code style.
Of the Cursor rule files we read, the 1,533 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository17 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .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/queues.mdcCursor rule
- .cursor/rules/scopes.mdcCursor rule
- btrace-perfettoSkill
- check-code-attributionSkill
- create-java-prSkill
- testSkill
The file
We split this api.mdc into the rules it gives an agent
4 rules. About 0 are common, 1 is distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 11
Never edit
.apifiles manually: Run ./gradlew apiDump to regenerate them. - Distinctive: line 50
When adding a new method that users can call (e.g.
- Very specific: line 70
Add serialization/deserialization in the relevant data class or create a new one implementing JsonSerializable and JsonDeserializer
- Very specific: line 73
Write tests for all implementations, especially Scope, Scopes, SentryTest, and any new data classes
≈ “Common” is an estimate: at least 1 in 5 of the 3,030 Cursor rule files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
--- alwaysApply: false description: Public API surface, binary compatibility, and common classes to modify --- # Java SDK Public API ## API Compatibility Public API is tracked via `.api` files generated by the [Binary Compatibility Validator](https://github.com/Kotlin/binary-compatibility-validator) Gradle plugin. Each module has its own file at `<module>/api/<module>.api`. - **Never edit `.api` files manually.** Run `./gradlew apiDump` to regenerate them. - `./gradlew check` validates current code against `.api` files and fails on unintended changes. - `@ApiStatus.Internal` marks classes/methods as internal — they still appear in `.api` files but are not part of the public contract. - `@ApiStatus.Experimental` marks API that may change in future versions. ## Key Public API Classes ### Entry Point `Sentry` (`sentry` module) is the static entry point. Most public API methods on `Sentry` delegate to `getCurrentScopes()`. When adding a new method to `Sentry`, it typically calls through to `IScopes`. ### Interfaces | Interface | Description | |-----------|-------------| | `IScope` | Single scope — holds data (tags, extras, breadcrumbs, attributes, user, contexts, etc.) | | `IScopes` | Multi-scope container — manages global, isolation, and current scope; delegates capture calls to `SentryClient` | | `ISpan` | Performance span — timing, tags, data, measurements | | `ITransaction` | Top-level transaction — extends `ISpan` | ### Configuration `SentryOptions` is the base configuration class. Platform-specific subclasses: - `SentryAndroidOptions` — Android-specific options - Integration modules may add their own (e.g. `SentrySpringProperties`) See the `options` rule for how to add and wire up a new option. ### Internal Classes (Not Public API) | Class | Description | |-------|-------------| | `SentryClient` | Sends events/envelopes to Sentry — receives captured data from `Scopes` | | `SentryEnvelope` / `SentryEnvelopeItem` | Low-level envelope serialization | | `Scope` | Concrete implementation of `IScope` | | `Scopes` | Concrete implementation of `IScopes` | ## Adding New Public API When adding a new method that users can call (e.g. a new scope operation), these classes typically need changes: ### Interfaces and Static API 1. `IScope` — add the method signature 2. `IScopes` — add the method signature (usually delegates to a scope) 3. `Sentry` — add static method that calls `getCurrentScopes()` ### Implementations 4. `Scope` — actual implementation with data storage 5. `Scopes` — delegates to the appropriate scope (global, isolation, or current based on `defaultScopeType`) 6. `CombinedScopeView` — defines how the three scope types combine for reads (merge, first-wins, or specific scope) ### No-Op and Adapter Classes 7. `NoOpScope` — no-op stub for `IScope` 8. `NoOpScopes` — no-op stub for `IScopes` 9. `ScopesAdapter` — delegates to `Sentry` static API 10. `HubAdapter` — deprecated bridge from old `IHub` API 11. `HubScopesWrapper` — wraps `IScopes` as `IHub` ### Serialization (if the data is sent to Sentry) 12. Add serialization/deserialization in the relevant data class or create a new one implementing `JsonSerializable` and `JsonDeserializer` ### Tests 13. Write tests for all implementations, especially `Scope`, `Scopes`, `SentryTest`, and any new data classes 14. No-op classes typically don't need separate tests unless they have non-trivial logic ## Protocol / Data Model Classes Classes in the `io.sentry.protocol` package represent the Sentry event protocol. They implement `JsonSerializable` for serialization and have a companion `Deserializer` class implementing `JsonDeserializer`. When adding new fields to protocol classes, update both serialization and deserialization. ## Namespaced APIs Newer features are namespaced under `Sentry.<feature>()` rather than added directly to `Sentry`. Each namespaced API has an interface, implementation, and no-op. Examples: - `Sentry.logger()` → `ILoggerApi` / `LoggerApi` / `NoOpLoggerApi` (structured logging, `io.sentry.logger` package) - `Sentry.metrics()` → `IMetricsApi` / `MetricsApi` / `NoOpMetricsApi` (metrics) Options for namespaced features are similarly nested under `SentryOptions`, e.g. `SentryOptions.getMetrics()`, `SentryOptions.getLogs()`. These APIs may share infrastructure like the type system (`SentryAttributeType.inferFrom()`) — changes to shared components (e.g. attribute types) may require updates across multiple namespaced APIs.
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.

