sentry-go
AGENTS.md1.1k starsChanged 17 months agoMITView on GitHub
Single-module Go SDK with integration sub-modules in github.com/getsentry/sentry-go. AI commits MUST include: The root package sentry contains the entire public API. Type-safe key-value builders used by structured logging and metrics: Each lives in its own directory with a separate go.mod: When adding a new integration, mirror an existing one. Current: transport.go (active) — HTTPTransport is the default implementation of an async transport. HTTPSyncTransport is the blocking variant for serverless. Next: internal/telemetry/ + internal/http/ (not yet enabled) — Processor/buffer/scheduler architecture. Wired…
Trending
Quiet since May.thin dataabout the whole repository
Who's talking about getsentry/sentry-go
- evalphobia/logrus_sentry“Support sentry-go?”GitHub · Jun 14, 2019 · 26 reactions
- prymitive/karma“Error: assignment to entry in nil map”GitHub · Jul 23, 2021 · 11 reactions
- getsentry/raven-go“New SDK sentry-go”GitHub · Mar 20, 2019 · 11 reactions
- superfly/flyctl“fly deploy hangs ~5-10% of the time with v0.1.52”GitHub · Jul 8, 2023 · 5 reactions
- rabesss/impartus-cli“chore(deps): consolidate dependabot updates”GitHub · May 6, 2026 · 4 reactions
The biggest 5 of 9 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 9
Talked about on GitHub (9 times).
On GitHub · 9
- Jun 14, 2019Support sentry-go? — evalphobia/logrus_sentry26 reactions · 7 comments
- Jul 23, 2021Error: assignment to entry in nil map — prymitive/karma11 reactions · 2 comments
- Mar 20, 2019New SDK sentry-go — getsentry/raven-go11 reactions
- Jul 8, 2023fly deploy hangs ~5-10% of the time with v0.1.52 — superfly/flyctlsays it tested it5 reactions · 9 comments
- May 6, 2026chore(deps): consolidate dependabot updates — rabesss/impartus-cli4 reactions · 4 comments
4 more on GitHub
- Apr 22, 2026report: v1.12.0 fails to compile against sentry-go v0.46.0 (event.Extra removed) — cockroachdb/errors4 reactions · 2 comments
- Feb 26, 2025Review — classic-terra/core3 reactions · 2 comments
- Jul 23, 2024feat: User Feedback widget/form — getsentry/sentry-cocoa3 reactions · 5 comments
- Nov 20, 2023Tracing: W3C Trace Context Support — getsentry/team-sdks3 reactions · 9 comments
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.
Of the AGENTS.md files we read, the 11,773 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 repository2 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- .cursor/rules/changelog.mdcCursor rule
The file
We split this AGENTS.md into the rules it gives an agent
7 rules. About 0 are common, 4 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
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
- Distinctive: line 42
When adding a new integration, mirror an existing one.
- Distinctive: line 61
Follow existing conventions — check neighboring files first
- Distinctive: line 66
Update tests when modifying behavior
- Distinctive: line 70
Test tier preference (use the highest tier that covers what you need):
- Very specific: line 81
Prefer fixture.Flush() over direct sentry.Flush(...) in tests built on internal/sentrytest
- Very specific: line 82
Prefer fixture.Events() as the captured event stream.
- Very specific: line 84
All tests must pass make test-race
≈ “Common” is an estimate: at least 1 in 5 of the 16,595 AGENTS.md 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
Sentry Go SDK
Single-module Go SDK with integration sub-modules in github.com/getsentry/sentry-go.
Commit Attribution
AI commits MUST include:
Co-Authored-By: <agent model name> <agent-email-or-noreply@example.com>Before Every Commit
make fmt2.make lint3.make vet4.make test-race
Architecture
Core (/)
The root package sentry contains the entire public API.
Attribute Package (/attribute/)
Type-safe key-value builders used by structured logging and metrics:
attribute.String("key", "value")
attribute.Int("count", 42)
attribute.Float64("ratio", 0.5)
attribute.Bool("flag", true)Integration Sub-Modules
Each lives in its own directory with a separate go.mod:
- HTTP middleware —
http/,gin/,echo/,fiber/,fasthttp/,iris/,negroni/ - Logging hooks —
logrus/,zerolog/,zap/,slog/ - Instrumentation —
httpclient/,otel/
When adding a new integration, mirror an existing one.
Transport Architecture
Current: transport.go (active) — HTTPTransport is the default implementation of an async transport. HTTPSyncTransport is the blocking variant for serverless.
Next: internal/telemetry/ + internal/http/ (not yet enabled) — Processor/buffer/scheduler architecture. Wired up in client.go (setupTelemetryProcessor) but commented out behind DisableTelemetryBuffer. Key parts:
internal/telemetry/processor.go— orchestrator; routes items to category-specific buffersinternal/telemetry/scheduler.go— weighted round-robin; errors get 5x priority over logsinternal/telemetry/ring_buffer.go— circular buffer with overflow policies and batch/timeout flushinginternal/telemetry/bucketed_buffer.go— groups items by trace IDinternal/http/transport.go—AsyncTransportwithHasCapacity()backpressureinternal/protocol/—Envelope,TelemetryIteminterfaces; log/metric batch types
The internalAsyncTransportAdapter in transport.go bridges old Transport to new TelemetryTransport.
Coding Standards
- Follow existing conventions — check neighboring files first
- Maintain existing Go versions and dependencies unless explicitly asked to change them
gofmt -sformatting, doc comments on exports- Public API in root package; internals in
/internal - Thread safety required — guard shared state with mutexes
- Update tests when modifying behavior
Testing
Test tier preference (use the highest tier that covers what you need):
- Integration tests (default) — Prefer
internal/sentrytestwithsentrytest.Runorsentrytest.NewFixture, plus real routers /httptestrequests where needed. Prefer tests that use the public API. - Context-level tests — Prefer
sentrytest.NewContextorfixture.NewContext(parent)for tracing / context propagation tests. Prefersentrytest.NewFixturefor isolated client + hub setup when no HTTP server is needed. - Unit tests (sparingly) — Direct
NewClient+MockScopeonly for self-contained logic wheresentrytestwould add unnecessary indirection.
Conventions:
- Table-driven tests for multiple inputs through the same code path
t.Parallel()for tests that don't share global statecmp.Diffwithcmpopts.IgnoreFieldsfor*Eventcomparison — ignoreEventID,Timestamp,Sdk,sdkMetaData- Prefer
fixture.Flush()over directsentry.Flush(...)in tests built oninternal/sentrytest - Prefer
fixture.Events()as the captured event stream; inspectevent.Typein assertions instead of relying on separate fixture streams testifyfor assertions,internal/testutils/for non-assert test helpers like mocks and flush timing- All tests must pass
make test-race
What to test:
- Behavior users observe: Does middleware capture panics? Does
Flushdeliver events? Do trace headers propagate? - Edge cases at system boundaries: malformed DSN, nil
Hub, concurrent captures, context cancellation - Regressions: reproduce the failure before applying the fix
Thread safety:
- The SDK is used concurrently. Any test touching shared state (
Hub,Scope,CurrentHub) must either uset.Parallel()with isolated instances, or explicitly verify safety with goroutines andsync.WaitGroup.
Reference
Skills
/commit— Commit with Sentry conventional format/create-pr— Create PRs following Sentry conventions/code-review— Review PRs following Sentry practices/find-bugs— Audit local changes for bugs and security issues
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.

