Snuba is Sentry's query and ingestion service on top of ClickHouse. The Python service is in snuba/, and the Rust Kafka consumers are in rust_snuba/.
Run these from the repository root.
devenv syncsyncs.venvand installs pre-commit hooks.make install-rs-devbuildsrust_snubainto.venv.devservices upstarts ClickHouse, Redis, and Kafka. The tests need them.make testruns the Python tests. Run one file withSNUBA_SETTINGS=test pytest tests/path/to/test_file.py.make test-rustruns the Rust tests.make lint-checkandmake typecheckrun ruff and mypy.pre-commit run --files <files>runs the commit hooks.make lint-rustandmake format-rustrun clippy and rustfmt.make validate-configsvalidates the dataset YAML insnuba/datasets/configuration/.make generate-config-docsand thenmake snubadocsbuild the Sphinx docs. Warnings fail the build.make listen-metricsprints the DogStatsD metrics Snuba emits locally.
- After you change Rust code, rerun
make install-rs-devbefore Python code or tests can use it. - Never edit
docs/source/configuration/*.mdby hand.make generate-config-docswrites them fromsnuba/datasets/configuration/json_schema.py. - Add every new page under
docs/source/to a toctree, or the docs build fails. - Snuba assumes UTC everywhere.