Skip to content

docs(local): document DSN-less capture, client-side wiring, and -f ai filter#1034

Open
sergical wants to merge 1 commit into
mainfrom
sdybskiy/local-docs-dsnless-client-note
Open

docs(local): document DSN-less capture, client-side wiring, and -f ai filter#1034
sergical wants to merge 1 commit into
mainfrom
sdybskiy/local-docs-dsnless-client-note

Conversation

@sergical
Copy link
Copy Markdown
Member

Summary

sentry local works well, but a few behaviors were undocumented and tripped up a user debugging logs/traces locally. This fills the gaps in the local command fragment + the agent guidance (which feeds the generated skill).

  • No DSN required. With no DSN configured, events flow only to the local server — nothing reaches the user's Sentry org and no production quota is used. With a DSN set, the SDK sends to both. This is the main reassurance for using spotlight in local dev and wasn't stated.
  • Client-side wiring caveat. sentry local run injects NEXT_PUBLIC_SENTRY_SPOTLIGHT, but no @sentry/* package reads it — only @sentry/node-core reads SENTRY_SPOTLIGHT (server-side). Browser/client SDKs need it referenced explicitly:
    Sentry.init({ spotlight: process.env.NEXT_PUBLIC_SENTRY_SPOTLIGHT ?? false });
    Other frameworks expose client env vars under different prefixes (Vite VITE_, CRA REACT_APP_). The docs previously implied the client var "just works."
  • -f ai filter. Documented for watching gen_ai/mcp agent spans while iterating on an agent.

Where it lands

  • docs/src/fragments/commands/local.md → the local docs page + generated skill reference.
  • docs/src/content/docs/agent-guidance.md → a new "Capture Events Locally" workflow. Since the skill generator keeps code blocks but strips prose, the key facts are encoded as comments in a bash snippet so they reach the agent skill too.
  • Regenerated SKILL.md + references/local.md accordingly (unrelated date-based reference drift left out; CI auto-commit handles that).

Notes

🤖 Generated with Claude Code

`sentry local` worked but a few things were undocumented and bit a user:

- No DSN required: with no DSN, events go only to the local server (nothing
  reaches the user's Sentry org / no production quota); with a DSN set, the
  SDK sends to both. Make this explicit — it's the main reassurance for using
  spotlight in local dev.
- NEXT_PUBLIC_SENTRY_SPOTLIGHT is injected but the SDK does NOT read it
  automatically. Server-side SDKs pick up SENTRY_SPOTLIGHT on their own;
  browser/client SDKs need `spotlight: process.env.NEXT_PUBLIC_SENTRY_SPOTLIGHT`
  wired into the client config (and other frameworks use VITE_/REACT_APP_).
- Document the `-f ai` filter for watching gen_ai/mcp agent spans.

Adds an agent-guidance "Capture Events Locally" workflow so the guidance also
reaches the generated agent skill (which keeps code blocks, strips prose).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown
Contributor

PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://cli.sentry.dev/_preview/pr-1034/

Built to branch gh-pages at 2026-05-29 02:09 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

@github-actions
Copy link
Copy Markdown
Contributor

Codecov Results 📊

✅ Patch coverage is 100.00%. Project has 4285 uncovered lines.
✅ Project coverage is 82%. Comparing base (base) to head (head).

Coverage diff
@@            Coverage Diff             @@
##          main       #PR       +/-##
==========================================
+ Coverage    82.00%    82.00%        —%
==========================================
  Files          329       329         —
  Lines        23806     23806         —
  Branches     15543     15543         —
==========================================
+ Hits         19522     19521        -1
- Misses        4284      4285        +1
- Partials      1643      1642        -1

Generated by Codecov Action

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