Skip to content
DocsGitHub

Migrating from Spotlight

Sentry Spotlight is deprecated in favor of sentry local, which ships in the Sentry CLI. It receives the same SDK traffic on the same default port, 8969, so most Sentry SDK setups keep working; SDK setup lists the ones that need a change. What changes is the command you run and where you look at events: the terminal, or the hosted viewer at local.sentry.dev.

Install the CLI, then replace spotlight with sentry local:

Terminal window
# Before
npx @spotlightjs/spotlight run
# After
sentry local run
Spotlight sentry local
spotlight, spotlight server sentry local serve, or just sentry local
spotlight tail sentry local serve (see below)
spotlight run [command] sentry local run [-- command]
spotlight mcp sentry local run --session <name>, then sentry local event list <name> --json; see Agents
Desktop app and the UI at http://localhost:8969 local.sentry.dev, opened with --open
ghcr.io/getsentry/spotlight image getsentry/sentry-cli image; see Docker

There is no sentry local tail. sentry local serve tails events, and when a Local or Spotlight server already holds the port, it connects to that server and tails its events instead of starting another one. That includes a running Spotlight sidecar, so you can switch one terminal at a time.

Pass the command for sentry local run after -- when it has flags of its own, such as sentry local run -- node --watch server.js. Without --, sentry local reads those flags as its own.

Spotlight's tail types are now the repeatable --filter (-f) flag:

spotlight tail sentry local
errors -f error, which includes messages such as captureMessage calls
traces -f transaction
logs -f log
attachments No filter
everything, all, * No -f
— -f ai for AI agent spans

For example, spotlight tail errors logs becomes sentry local -f error -f log.

Spotlight sentry local
-p, --port <port> -p, --port <port>. 0 picks a free port, as before
-o, --open -o, --open. It needs a loopback --host
-f, --format <format> -F, --format <format>. -f is --filter now
--format md, --format logfmt No equivalent. Use -F json for machine-readable output, or the default human format
-d, --debug --log-level debug
-A, --allowed-origin <origin> Same flag, with stricter values; see Browser origins
— -H, --host on serve, --host on run

In the default human format, sentry local writes the tail to standard error. With -F json, it writes NDJSON records to standard output and keeps status messages on standard error. See JSON output for the record format.

spotlight run set SENTRY_SPOTLIGHT, NEXT_PUBLIC_SENTRY_SPOTLIGHT, and SENTRY_TRACES_SAMPLE_RATE=1. sentry local run sets the same three, but keeps a SENTRY_TRACES_SAMPLE_RATE you already set, and adds:

Variable Value
PUBLIC_SENTRY_SPOTLIGHT, VITE_SENTRY_SPOTLIGHT, NUXT_PUBLIC_SENTRY_SPOTLIGHT, REACT_APP_SENTRY_SPOTLIGHT, VUE_APP_SENTRY_SPOTLIGHT, GATSBY_SENTRY_SPOTLIGHT Same URL as SENTRY_SPOTLIGHT
SENTRY_RELEASE sentry-cli-local, unless already set
SENTRY_DSN With --session, the session's DSN for Ruby, Go, Rust, and Elixir apps, unless already set

SENTRY_SPOTLIGHT is http://localhost:<port>/stream for a plain run, as with Spotlight. With --session, it's the session's URL on the Local daemon, such as http://localhost:8969/stream/<id>.

It also differs from spotlight run in these ways:

  • App output is not captured as logs. spotlight run sent your app's standard output and standard error to Spotlight as log events. sentry local run passes them through to your terminal unchanged (to standard error with -F json) and shows only what the SDK sends. To see logs, send them with your SDK's logs feature.
  • Port 8969 may move. When the Local daemon behind --session holds port 8969, a plain sentry local run listens on a free port and says so. SDKs that read SENTRY_SPOTLIGHT follow it. One that hard-codes 8969 doesn't, so pass --session <name> or a free --port instead.
  • Detection order. With no command, Spotlight looked for a Compose file before package.json. sentry local run checks Laravel and Rails, then package.json, then Python, Ruby, Rust, and Go projects, and Compose last; see the full list. Pass the command after -- to skip detection.

Most setups need no change. A plain sentry local serve or sentry local run accepts envelopes on POST /stream and on the regular /api/<project-id>/envelope/ ingest path, on port 8969 by default, so SDKs that send to Spotlight, through SENTRY_SPOTLIGHT or the spotlight option, reach it the same way.

Change your setup when:

  • The SDK hard-codes port 8969, such as spotlight: true with no SENTRY_SPOTLIGHT. While the Local daemon behind --session holds 8969, a plain run moves to a free port, and the daemon refuses POST /stream and /api/<project-id>/envelope/ on its root. The Node.js and Python SDKs then drop their events without an error. Have the SDK read SENTRY_SPOTLIGHT.
  • You use --session. The SDK must keep the path of the session's URL when it sends. Node.js and Python do. Ruby keeps only the host and port, so local run --session sets SENTRY_DSN for it; see Daemon-owned sessions.
  • Your page isn't served from localhost. See Browser origins.
  • Your app runs in Docker Compose. See Docker.

SDK setup covers each runtime, including the ones that need a line of config.

Spotlight served its UI from the sidecar at http://localhost:8969 and in the Electron desktop app. sentry local has no bundled UI. The viewer is hosted at local.sentry.dev and reads events from your receiver over loopback:

  • sentry local run and sentry local serve print a View events at link, and --open opens it.
  • Opening the receiver itself, such as http://localhost:8969/, redirects to that link.
  • Chrome asks once before local.sentry.dev can reach localhost. Allow Local network access when it asks.

Quit the desktop app before you switch, or sentry local connects to the app's sidecar on port 8969 instead of starting its own server. See Browser UI for the rest.

sentry local has no MCP server. Agents use the CLI and its JSON output instead. Capture a run into a named session, then query it, even after the app exits:

Terminal window
sentry local run --session web -- npm run dev
sentry local event list web --json
sentry local event view web <event-id> --json

event list covers errors, messages, transactions, and logs, which search_errors, search_logs, and search_traces returned. event view returns one event with its raw envelope, and accepts the short ID that event list prints. To watch events as they arrive, stream NDJSON instead:

Terminal window
sentry local run --format json -f error -f transaction -f log -f ai -- npm run dev

See Daemon-owned sessions for how long sessions keep their events.

The getsentry/sentry-cli image replaces ghcr.io/getsentry/spotlight. Its entrypoint is sentry (see Docker). Inside a container, localhost is the container, so bind to all interfaces with --host 0.0.0.0 and publish the port:

Terminal window
docker run --rm -p 8969:8969 getsentry/sentry-cli local serve --host 0.0.0.0

sentry local run -- docker compose up sets its variables on the docker compose process only, not inside your containers. Spotlight's run passed SENTRY_SPOTLIGHT into each service, pointed at host.docker.internal. sentry local run doesn't, so apps in your containers don't get the URL.

An Android emulator reaches your machine at 10.0.2.2. A plain sentry local serve or sentry local run accepts events sent to http://10.0.2.2:8969/stream. The daemon behind --session answers only requests addressed to a loopback host, so it refuses them.

A physical device sends to your machine's network address. Spotlight's sidecar listened on every interface, but sentry local listens only on localhost by default, so start it with sentry local serve --host 0.0.0.0.

sentry local accepts browser requests from loopback origins, such as http://localhost:3000, and from local.sentry.dev. For a page served from another origin, such as https://myapp.local or a tunnel, list it with -A, --allowed-origin, as with Spotlight:

Terminal window
sentry local run -A https://myapp.local -- npm run dev

Some things differ from Spotlight:

  • No automatic local hostnames. Spotlight also trusted any hostname that resolved to your machine, such as myapp.local in /etc/hosts. sentry local doesn't, so list it with -A myapp.local.
  • Stricter values. A full origin such as https://myapp.local:3000 matches only that scheme, host, and port, and a bare hostname matches it on any scheme and port. Wildcards such as *, paths, and host:port without a scheme are rejected instead of ignored.
  • Not with --session. -A applies only to a server that local serve or local run starts. The Local daemon behind --session takes no listed origins, and a server already running on the port keeps its own.
  • Truncated items. When an item in an envelope is shorter than its declared length, such as a cut-off screenshot attachment, sentry local treats the envelope as malformed and the tail shows none of its items. Spotlight still showed the envelope's error.
  • Messages count as errors. -f error includes events with no exception, such as captureMessage calls and Python logging records. In JSON they are "type":"message" records.