Django backend for GlitchTip https://glitchtip.com/

David Burke 2370bb6a5f Merge branch 'fix/341-project-id' into 'master' 18 hours ago
.vscode 480a404021 . 1 year ago
apps 2370bb6a5f Merge branch 'fix/341-project-id' into 'master' 18 hours ago
assets 7b290b5349 HTML emails! 4 years ago
bin 4e835bc454 Add default CELERY_WORKER_MAX_TASKS_PER_CHILD 1 week ago
bitfield c115d82480 lint 1 year ago
django_rest_mfa a34cbea6e6 Stub out django rest mfa for migration need only 2 months ago
events 99524e6a65 Remove 3.x to 4.x event migration. 4 months ago
glitchtip 190efaa124 Add django humanize for commas on event counts/limits in email. Add marketing link for directing to FAQ. 1 week ago
issues 9d44e0db05 Add old issue/event deletion 7 months ago
monitoring 13dd870b9d Add prometheus to docker compose for testing 2 years ago
psqlextra 974dc01207 Add IssueTag with partition 9 months ago
sentry be91e188f5 Remove unnecessary space 7 months ago
templates 7eb460f784 Add new email base template and extend it for new throttle warning email 1 month ago
test_api 724150c705 Exempt seed_data view from CSRF 2 months ago
uploads 40f7adec8c Add uploads folder to repo with gitignore 2 years ago
.dockerignore 56fcdde1c7 Use uv instead of poetry 1 month ago
.gitignore b14d28fc52 . 3 months ago
.gitlab-ci.yml a82d147376 Update renovate/renovate Docker tag to v39 2 weeks ago
.pylintrc 055e638728 working on adding linting and isort on CI 3 years ago
CHANGELOG 9d2f1dc40c Merge branch 'master' of gitlab.com:glitchtip/glitchtip-backend into set-org-throttle 3 weeks ago
CONTRIBUTING.md 462307a28d Update CONTRIBUTING.md 9 months ago
Dockerfile 56fcdde1c7 Use uv instead of poetry 1 month ago
LICENSE 5718e945ba Add license 5 years ago
NOTICE.md 8b3a243b24 Add environment tag creation 4 years ago
README.md b5517b6870 Move org viewset to ninja 5 months ago
app.py be76f7940f . 2 months ago
docker-compose.locust.yml e30c55ccc7 First pass at removing old issues and events 8 months ago
docker-compose.metrics.yml 13dd870b9d Add prometheus to docker compose for testing 2 years ago
docker-compose.yml 65b9839635 Fix DebugImage not picking the correct type for mysterious reasons 1 week ago
locustfile.py d5563370bb Remove more issues/events 8 months ago
manage.py eaeeddab42 Update black 1 year ago
pyproject.toml 7d68415fd9 Update packages 4 weeks ago
renovate.json 93b7dc05f9 . 1 year ago
uv.lock 2187e87207 Merge branch 'renovate/aiohttp-3.x-lockfile' into 'master' 1 day ago

README.md

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 5, 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 1GB of ram, PostgreSQL, and Redis.
  • 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

  1. Ensure docker and docker-compose are installed
  2. docker compose up
  3. docker compose run --rm web ./manage.py migrate

Run tests with docker-compose run --rm web ./manage.py test

Run HTTPS locally for testing FIDO2 keys

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

VS Code (Optional)

VS Code can do type checking and type inference. However, it requires setting up a virtual environment.

  1. Install Python. For Ubuntu this is apt install python3-dev python3-venv
  2. Install poetry
  3. Create Python virtual environment python -m venv env
  4. Activate environment source env/bin/activate
  5. Install packages poetry install

Load testing

First set the env var IS_LOAD_TEST to true in docker-compose.yml

Locust is built into the dev dependencies. To run with Locust run docker compose -f docker-compose.yml -f docker-compose.locust.yml up

Now go to localhost:8089 to run the test.

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

Observability metrics with Prometheus

  1. Edit monitoring/prometheus/prometheus.yml and set credentials to a GlitchTip auth token
  2. docker compose -f docker-compose.yml -f docker-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 element.io 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