agentleFS
SentryKnown publishergetsentry/sentry-go/AGENTS.md

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

Dec 2025: 0 mentionsJan 2026: 0 mentionsFeb 2026: 0 mentionsMar 2026: 0 mentionsApr 2026: 1 mentionMay 2026: 1 mentionJun 2026: 0 mentionsJul 2026: 0 mentionsAug 2026: 0 mentionsSep 2026: 0 mentionsOct 2026: 0 mentionsNov 2026: 0 mentions
Dec 2025Jun 2026Nov 2026
Mentions a month of the getsentry/sentry-go repository that our weekly crawl found: only 9 in all, so this is a hint, not a trend. There is no adoption data for this file yet.

Who's talking about getsentry/sentry-go

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

4 more on GitHub
  • 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.

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
  1. Distinctive:

    When adding a new integration, mirror an existing one.

    line 42
  2. Distinctive:

    Follow existing conventions — check neighboring files first

    line 61
  3. Distinctive:

    Update tests when modifying behavior

    line 66
  4. Distinctive:

    Test tier preference (use the highest tier that covers what you need):

    line 70
  5. Very specific:

    Prefer fixture.Flush() over direct sentry.Flush(...) in tests built on internal/sentrytest

    line 81
  6. Very specific:

    Prefer fixture.Events() as the captured event stream.

    line 82
  7. Very specific:

    All tests must pass make test-race

    line 84

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
AGENTS.md

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

  1. make fmt 2. make lint 3. make vet 4. 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 buffers
  • internal/telemetry/scheduler.go — weighted round-robin; errors get 5x priority over logs
  • internal/telemetry/ring_buffer.go — circular buffer with overflow policies and batch/timeout flushing
  • internal/telemetry/bucketed_buffer.go — groups items by trace ID
  • internal/http/transport.go — AsyncTransport with HasCapacity() backpressure
  • internal/protocol/ — Envelope, TelemetryItem interfaces; 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 -s formatting, 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):

  1. Integration tests (default) — Prefer internal/sentrytest with sentrytest.Run or sentrytest.NewFixture, plus real routers / httptest requests where needed. Prefer tests that use the public API.
  2. Context-level tests — Prefer sentrytest.NewContext or fixture.NewContext(parent) for tracing / context propagation tests. Prefer sentrytest.NewFixture for isolated client + hub setup when no HTTP server is needed.
  3. Unit tests (sparingly) — Direct NewClient + MockScope only for self-contained logic where sentrytest would add unnecessary indirection.

Conventions:

  • Table-driven tests for multiple inputs through the same code path
  • t.Parallel() for tests that don't share global state
  • cmp.Diff with cmpopts.IgnoreFields for *Event comparison — ignore EventID, Timestamp, Sdk, sdkMetaData
  • Prefer fixture.Flush() over direct sentry.Flush(...) in tests built on internal/sentrytest
  • Prefer fixture.Events() as the captured event stream; inspect event.Type in assertions instead of relying on separate fixture streams
  • testify for 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 Flush deliver 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 use t.Parallel() with isolated instances, or explicitly verify safety with goroutines and sync.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

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.