Django backend for GlitchTip.
  • Python 91.3%
  • HTML 7.5%
  • Shell 0.7%
  • PLpgSQL 0.2%
  • JavaScript 0.2%
Find a file
David Burke 36bc50fa33 Merge branch 'fix/drop-issue-id-fk-partitioned-tables' into 'master'
fix: drop issue_id FK constraints on partitioned tables

See merge request glitchtip/glitchtip-backend!2230
2026-03-24 20:26:46 +00:00
.vscode . 2023-11-16 11:12:07 -05:00
.zed search vector migration 2025-05-27 18:25:47 -04:00
apps fix: drop issue_id FK constraints on partitioned tables 2026-03-24 10:05:43 -04:00
assets/images HTML emails! 2020-05-01 23:20:53 -04:00
benchmarks perf: tune glibc MMAP/TRIM thresholds to reduce RSS by ~50% 2026-03-24 07:12:33 -04:00
bin perf: tune glibc MMAP/TRIM thresholds to reduce RSS by ~50% 2026-03-24 07:12:33 -04:00
bitfield Add async cache usage 2026-01-05 16:34:49 -05:00
docs/ai docs: add QA testing checklist and known API differences 2026-02-27 15:56:38 -05:00
events/test_data Some test cleanup 2026-01-22 21:06:56 -08:00
glitchtip test: add unit test for CancelledError suppression in middleware 2026-03-21 10:15:32 -04:00
integration_tests Fix DSN hostname for CI docker-in-docker environment 2026-01-25 16:47:29 -05:00
monitoring/prometheus Add prometheus to docker compose for testing 2022-07-25 20:47:59 -04:00
psql_partition lint 2026-01-15 15:33:49 -05:00
scripts perf: replace executemany with CSV-based archival (~90x faster) 2026-02-26 10:39:16 -05:00
sentry lint 2026-02-10 09:24:10 -05:00
templates Add new email base template and extend it for new throttle warning email 2024-10-21 10:50:02 -04:00
test_api Add first_event to seeded project with seeded events 2026-03-20 10:51:24 -04:00
uploads Add uploads folder to repo with gitignore 2022-09-22 10:33:59 -04:00
.dockerignore Use uv instead of poetry 2024-10-11 10:47:07 -04:00
.gitignore docs: Add AI agent guidelines and compatibility links 2026-01-27 11:20:42 -05:00
.gitlab-ci.yml ci: update lint image to Python 3.14 2026-03-18 12:52:43 -04:00
.pre-commit-config.yaml chore: add pre-commit hooks for ruff and vulture 2026-03-05 18:02:29 -05:00
.pylintrc working on adding linting and isort on CI 2021-10-28 20:22:09 -04:00
AGENTS.md Update agents.md 2026-03-17 12:17:34 -04:00
AI_POLICY.md Add ai policy 2026-02-05 15:01:56 +00:00
CHANGELOG docs: add 6.1.1 changelog 2026-03-23 15:12:39 -04:00
CLAUDE.md docs: Add AI agent guidelines and compatibility links 2026-01-27 11:20:42 -05:00
compose.cold-volume.yml feat: remove ColdStorageConfig, support filesystem cold storage 2026-02-14 10:13:37 -05:00
compose.e2e.no-valkey.yml Add CI matrix for e2e tests 2026-01-25 12:35:40 -05:00
compose.e2e.web-worker.yml Add CI matrix for e2e tests 2026-01-25 12:35:40 -05:00
compose.e2e.yml Add CI matrix for e2e tests 2026-01-25 12:35:40 -05:00
compose.locust.yml Fix type error in process events. Rename docker compose to compose 2025-08-05 10:20:59 -04:00
compose.metrics.yml Fix type error in process events. Rename docker compose to compose 2025-08-05 10:20:59 -04:00
compose.minio.yml refactor: remove MinIO from default compose, add compose.minio.yml overlay 2026-02-11 13:12:53 -05:00
compose.yml feat: add MCP tools for log events and enable logs in dev 2026-02-16 09:59:13 -05:00
CONTRIBUTING.md Add make shortcuts to README 2025-11-11 04:39:31 -03:00
Dockerfile fix: improve OpenAPI spec correctness for TypeScript type generation 2026-03-17 18:09:13 -04:00
healthcheck.py Add CI matrix for e2e tests 2026-01-25 12:35:40 -05:00
LICENSE Add license 2019-12-08 10:40:43 -05:00
locustfile.py Migrate tasks and use vtasks immediate backend 2026-01-05 16:34:58 -05:00
Makefile dbshell executes psql inside postgres service 2025-11-11 12:11:30 -03:00
manage.py Add async cache usage 2026-01-05 16:34:49 -05:00
NOTICE.md Add environment tag creation 2020-11-18 21:05:19 -05:00
pyproject.toml chore(deps): update dependency django-stubs to v6 2026-03-17 06:05:45 +00:00
README.md docs: clarify that frontend repo is needed for local dev UI 2026-02-11 08:43:00 -05:00
renovate.json . 2023-05-25 09:27:46 -04:00
uv.lock chore(deps): update dependency symbolic to v12.17.3 2026-03-24 07:05:10 +00:00
vulture_whitelist.py refactor: remove dead code and add vulture CI check 2026-02-18 13:14:53 -05:00

Gitter

GlitchTip Backend

GlitchTip is an open source, Sentry API compatible error tracking platform. It is a partial fork/mostly re-implementation of Sentry's open source codebase before it went proprietary. Its goals are to be a modern, easy-to-develop error tracking platform that respects your freedom to use it any way you wish. Some differences include:

  • A modern development environment with Python 3, Django 6, async, and types.
  • Simplicity over features. We use Postgres to store error data. Our code base is a fraction of the size of Sentry and looks like a typical Django app. We leverage existing open source Django ecosystem apps whenever possible.
  • Lightweight - GlitchTip runs with as little as 512MB of ram. We use PostgreSQL. Valkey is optional improved performance.
  • Respects your privacy. No massive JS bundles. No invasive tracking. No third party spying. Our marketing site runs the privacy-focused Plausible analytics. Self hosted GlitchTip will never report home. We will never know if you run it yourself.
  • Commitment to open source. We use open source tools like GitLab whenever possible. With our MIT license, you can use it for anything you'd like and even sell it. We believe in competition and hope you make GlitchTip even better.

GlitchTip is a stable platform used in production environments for several years.

Developing

We use Docker for development. View our Contributing documentation if you'd like to help make GlitchTip better. See API Documentation

Run local dev environment

This repo is the backend API only. To get a working web UI, you also need the GlitchTip Frontend. Without the frontend, you will see TemplateDoesNotExist errors when opening the site in a browser.

  1. Ensure docker and docker-compose are installed
  2. Execute docker compose up (or make start)
  3. Execute docker compose run --rm web ./manage.py migrate (or make migrate)
  4. Clone and run the frontend with npm start — it proxies API requests to the backend automatically

Run tests with docker compose run --rm web ./manage.py test (or make test) and see the logs with docker compose logs -ft (or make logs).

Execute make help for more shortcuts.

Run HTTPS locally for testing FIDO2 keys

  1. cp compose.yml compose.override.yml
  2. Edit the override file and set command: ./manage.py runsslserver 0.0.0.0:8000
  3. Restart docker compose services

Run with advanced partitioning

Using pg_partman requires the extension to be installed in postgres. compose.part.yml offers an alternative image. Switching between advanced and default partitioning is not supported.

Execute the containers by running:

docker compose -f compose.yml -f compose.part.yml up
# or: make partman-start

This automatically configures pg_partman but you can update it manually with ./manage.py setup_advanced_partitions.

Default partitioning uses DATE partitions managed by Django. Advanced partitioning uses nested ORG_ID HASH > DATE partitions managed by pg_partman.

Load testing

We use Locust to load test. It's built into the dev dependencies.

First, set the env var IS_LOAD_TEST to true in compose.yml, then run:

docker compose -f compose.yml -f compose.locust.yml up
# or: make locust-start

Now go to localhost:8089 to run the test.

Note: Locust will not be installed to production docker images and cannot be run from them.

Memory profiling

Use memray to profile. For example we can profile celery beat (bin/run-beat.sh) with

exec memray run /usr/local/bin/celery -A glitchtip beat -s /tmp/celerybeat-schedule -l info --pidfile=

Then run memray flamegraph file.bin on the above file output.

Observability metrics with Prometheus

  1. Edit monitoring/prometheus/prometheus.yml and set credentials to a GlitchTip auth token
  2. Execute docker compose -f compose.yml -f compose.metrics.yml up

GCP Logging

In order to enable json logging, set the environment as follows::

DJANGO_LOGGING_HANDLER_CLASS=google.cloud.logging_v2.handlers.ContainerEngineHandler
UWSGI_LOG_ENCODER='json {"severity":"info","timestamp":${unix},"message":"${msg}"}}'

Acknowledgements

  • Thank you to the Sentry team for their ongoing open source SDK work and formerly open source backend of which this project is based on.
  • We use gitter for our public gitter room
  • Plausible Analytics is used for analytics
  • Django - no other web framework is as feature complete
  • django-ninja/Pydantic - brings typed and async-first api design