Skip to content

[DO NOT MERGE] feat: Point coding agents to a setup checklist - #8269

Draft
wedamija wants to merge 3 commits into
masterfrom
danf/warn-zero-traces-sample-rate
Draft

wedamija wants to merge 3 commits into
masterfrom
danf/warn-zero-traces-sample-rate

Conversation

@wedamija

@wedamija wedamija commented Nov 13, 2026 •

Copy link
Copy Markdown
Member

This draft is a proof of concept to show a proposal. It isn't ready for review yet.

Coding agents that set up Sentry usually write the config from memory and leave tracing and logs off. This adds a one-line hint for them, and a short setup checklist that ships with the package.

When the SDK runs under a coding agent (AI_AGENT, CLAUDECODE, CODEX_THREAD_ID, CODEX_SANDBOX, CURSOR_AGENT or GEMINI_CLI, and not in CI), a DSN is set, and tracing or logs is off, it prints one line to stderr at exit. The line points to sentry_sdk/SETUP_CHECKLIST.md. It doesn't print for people who run the app themselves.

The checklist ships in the package instead of linking to the docs because agents rarely open a URL they see in command output, but they do read local files. A file in the package also always matches the installed SDK version.

The hint can be turned off with SENTRY_AGENT_HINTS=0, or with the new agent_setup_complete=True option, which the checklist asks agents to set once they've gone through it.

A lot of new setups, many of them written by AI coding agents, configure
tracing but set traces_sample_rate to 0, often through a setting or
environment variable that defaults to 0 and is never set. The SDK then
instruments every request, starts no traces and sends no performance data,
and nothing tells anyone. Most of these setups stay that way.

Warn at init when traces_sample_rate is 0 and no traces_sampler is set. It
uses warnings.warn rather than the SDK logger, because the logger only
writes when debug is on. The message says how to send traces, and that the
warning can be hidden with warnings.filterwarnings when 0 is intentional
(for example, to only continue traces sampled upstream).

There's no warning when traces_sample_rate isn't set, is None, or is above
0, or when a traces_sampler is set.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@wedamija wedamija closed this Nov 14, 2026
@github-actions

github-actions Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Coverage Results 📊

✅ 139126 passed | ⏭️ 7850 skipped | Total: 146976 | Pass Rate: 94.66% | Execution Time: 439m 41s

📊 Comparison with Base Branch

Metric Change
Total Tests 📉 -109
Passed Tests 📉 -101
Failed Tests 📉 -1
Skipped Tests 📉 -7

➖ Removed Tests (1)

View removed tests
  • test_profile_captured
    • File: tests.profiler.test_transaction_profiler

All tests are passing successfully.

✅ Patch coverage is 100.00% (28 of 28 changed executable lines covered; target 80%).
Project statement coverage is 90.21%.

Changed files with executable lines (1)
File Patch coverage Changed executable lines
sentry_sdk/client.py 100.00% 28/28 covered

Generated by Coverage Action

Coding agents that set up Sentry usually write the config from memory and leave tracing and logs off. This adds a one-line hint for them, and a short setup checklist that ships with the package.

When the SDK runs under a coding agent (`AI_AGENT`, `CLAUDECODE`, `CODEX_THREAD_ID`, `CODEX_SANDBOX`, `CURSOR_AGENT` or `GEMINI_CLI`, and not in `CI`), a DSN is set, and tracing or logs is off, it prints one line to stderr at exit. The line points to `sentry_sdk/SETUP_CHECKLIST.md`. It doesn't print for people who run the app themselves.

The checklist ships in the package instead of linking to the docs because agents rarely open a URL they see in command output, but they do read local files. A file in the package also always matches the installed SDK version.

The hint can be turned off with `SENTRY_AGENT_HINTS=0`, or with the new `agent_setup_complete=True` option, which the checklist asks agents to set once they've gone through it.
@wedamija wedamija changed the title [DO NOT MERGE] feat(tracing): Warn when traces_sample_rate is 0 [DO NOT MERGE] feat: Point coding agents to a setup checklist Nov 16, 2026
@wedamija wedamija reopened this Nov 16, 2026
Start the hint with what Sentry isn't getting (tracing, logs or both), so an agent that doesn't open the checklist can still tell the user what's missing.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant