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:
# Beforenpx @spotlightjs/spotlight run
# Aftersentry local runCommands
Section titled “Commands”| 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.
sentry local run
Section titled “sentry local run”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 runsent your app's standard output and standard error to Spotlight as log events.sentry local runpasses 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
--sessionholds port 8969, a plainsentry local runlistens on a free port and says so. SDKs that readSENTRY_SPOTLIGHTfollow it. One that hard-codes 8969 doesn't, so pass--session <name>or a free--portinstead. - Detection order. With no command, Spotlight looked for a Compose file
before
package.json.sentry local runchecks Laravel and Rails, thenpackage.json, then Python, Ruby, Rust, and Go projects, and Compose last; see the full list. Pass the command after--to skip detection.
SDK setup
Section titled “SDK setup”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: truewith noSENTRY_SPOTLIGHT. While the Local daemon behind--sessionholds 8969, a plain run moves to a free port, and the daemon refusesPOST /streamand/api/<project-id>/envelope/on its root. The Node.js and Python SDKs then drop their events without an error. Have the SDK readSENTRY_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, solocal run --sessionsetsSENTRY_DSNfor 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.
Viewer instead of the desktop app
Section titled “Viewer instead of the desktop app”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 runandsentry local serveprint a View events at link, and--openopens 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.
Agents instead of spotlight mcp
Section titled “Agents instead of spotlight mcp”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:
sentry local run --session web -- npm run devsentry local event list web --jsonsentry local event view web <event-id> --jsonevent 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:
sentry local run --format json -f error -f transaction -f log -f ai -- npm run devSee Daemon-owned sessions for how long sessions keep their events.
Docker
Section titled “Docker”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:
docker run --rm -p 8969:8969 getsentry/sentry-cli local serve --host 0.0.0.0sentry 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.
Android emulators
Section titled “Android emulators”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.
Browser origins
Section titled “Browser origins”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:
sentry local run -A https://myapp.local -- npm run devSome things differ from Spotlight:
- No automatic local hostnames. Spotlight also trusted any hostname that
resolved to your machine, such as
myapp.localin/etc/hosts.sentry localdoesn't, so list it with-A myapp.local. - Stricter values. A full origin such as
https://myapp.local:3000matches only that scheme, host, and port, and a bare hostname matches it on any scheme and port. Wildcards such as*, paths, andhost:portwithout a scheme are rejected instead of ignored. - Not with
--session.-Aapplies only to a server thatlocal serveorlocal runstarts. The Local daemon behind--sessiontakes no listed origins, and a server already running on the port keeps its own.
Other differences
Section titled “Other differences”- Truncated items. When an item in an envelope is shorter than its
declared length, such as a cut-off screenshot attachment,
sentry localtreats the envelope as malformed and the tail shows none of its items. Spotlight still showed the envelope's error. - Messages count as errors.
-f errorincludes events with no exception, such ascaptureMessagecalls and Pythonloggingrecords. In JSON they are"type":"message"records.