Skip to content

Add sentry doctor with SDK-owned check metadata #1632

Open

Description

@sentry-junior

getsentry/cli#1501 prototyped sentry doctor, a read-only health check for an existing Sentry install. It scans the project, asks the API, and reports what is configured, what is broken, and what to fix. It supports --send-test-event and a dry-run --fix plan, and was live-tested on Android, Empower, and iOS projects. The PR is closing with the getsentry/cli archive, and BYK's review asked for a reshaped version before a command like this can land.

cc @romtsn, author of cli#1501.

Design direction (from BYK's review of cli#1501)

  • SDK knowledge lives outside the CLI. Check lists, manifests, and init/build markers should come from one central place that the SDKs control and every product can read, most likely the release registry. The CLI should download that data at runtime rather than embed it at build time.
  • No hand-rolled parser. Replace the custom capture-block parser with tree-sitter or ast-grep.
  • Reuse existing CLI code instead of reimplementing it:
    • If DSN discovery is missing something, improve the existing DSN discovery so every command benefits.
    • Use the existing send-event command for --send-test-event.
    • Make redaction, if needed, a generic output-layer helper.
    • Drop the doctor-specific flush timeout.
    • Revert the unrelated lib/dsn/code-scanner.ts change.
  • Fixes go through an agent. --fix should produce a report for agents, or go through the sentry init backend, instead of keeping its own fix system. @betegon owns the init backend.
  • Clarify the names and concepts:
    • Rename the doctor online mode (for example to online) so it doesn't read like a subcommand.
    • Explain what tier 1 and tier 2 checks mean.
    • Explain magic numbers such as 31 in live.ts.
  • Ship it smaller. The PR was large and hard to review. Split it into reviewable pieces.

Related

Refs getsentry/cli#1501

via BYK.

--

View Junior Session in Sentry

Activity

  1. linear-code commented on Oct 23, 2026

    @linear-code
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions