Backend Development Server

(see also: Frontend Development Server)

It's possible to run Sentry locally without ever having to build the frontend. It requires to circumvent sentry devserver. Instead, you configure:

Copied
# ~/.sentry/sentry.conf.py
STATIC_URL = "https://sentry.io/_static/{version}"
STATIC_FRONTEND_APP_URL = "https://sentry.io/_static/dist/"

...and run:

Copied
sentry run web

When you browse localhost:9001, the browser will load JavaScript from production instead of your local static folder.

This will do literally nothing except bring up the web workers. You are now responsible to manually:

  • Starting Relay if you need it: sentry devservices attach relay
  • Starting relevant Kafka consumers if you need them (e.g. for ingestion). This highly depends on which dataset you're working on.
  • Starting Celery workers using sentry run worker to run most kinds of background jobs.

Use sentry run --help to see what you might be missing by not running devserver.

Using ngrok

The development server can be operated behind ngrok for when you need to receive traffic from the outside world. This comes up frequently when working with integrations. Start off by defining a configuration file for ngrok:

Copied
version: '2'
authtoken: <YOUR-NGROK-AUTHTOKEN>
tunnels:
  acme-org
    proto: http
    hostname: $yourname.ngrok.dev
    addr: 8010
    host_header: 'rewrite'

Next start up ngrok with your configuration file:

Copied
ngrok start --all --config ngrok.yml`

When starting devserver provide your ngrok domain

Copied
sentry devserver --ngrok=$yourname.ngrok.dev
You can edit this page on GitHub.