Skip to main content

incident-replay

incident-replay is a deterministic backend incident capture and replay system for Django applications. It automatically captures the minimal database, cache, environment, and external API state surrounding failing production requests, generating a portable incident snapshot.

You can then deterministically replay these incidents locally on your machine with a single CLI command!

Features (v0.1.0 MVP)

  • Failing Request Capture: Intercepts HTTP 500s or Python unhandled exceptions via standard Django Middleware.
  • Minimal Data Extraction Engine: Traces all SQL executed during a bad request, calculates foreign key dependencies automatically via Django models, and saves ONLY the rows accessed (no full database dumps needed!).
  • Portable Snapshots: Generates INC-<ULID>/ snapshots containing serialized JSON artifacts request.json, query_trace.json, metadata.json, and db_snapshot.json.
  • Deterministic CLI Replay: Spin up incidents directly in your local environment. Replay engine initializes an ephemeral SQLite schema automatically, loads the minimal DB snapshot, mocks out UUID generation and Time (WIP), and deterministically crashes with the exact same stack-trace.

Installation

pip install incident-replay

Add to your Django project settings:

INSTALLED_APPS = [
    # ...
    # Any specific apps...
]

MIDDLEWARE = [
    'incident_replay.capture.middleware.IncidentReplayMiddleware',
    # ... your other middleware
]

# Local directory where snapshots are placed (S3 integrations planned)
INCIDENT_REPLAY_STORAGE_DIR = "/tmp/incident_snapshots" 

Usage

1. Wait for an Incident

When your application throws an internal server error (or if a manual trigger header X-Incident-Trigger: true is sent), incident-replay captures it to your storage backend.

2. List Incidents

incident-replay list

3. Replay locally!

You must set your DJANGO_SETTINGS_MODULE to run the replay engine.

DJANGO_SETTINGS_MODULE=myproject.settings incident-replay run INC-01JEXAMPLEID1234

You will see the identical stack trace error out on your terminal.


Core Principles

  1. Developer First: Focus on exactly what broke during a single request execution timeline.
  2. Minimal Data Universe: Extracts rows that matter. No PII leaking across massive table dumps.
  3. Low Overhead: Uses passive DB cursor tracing <5% overhead on the critical path. Snapshot serialization only occurs off the critical path or synchronously on failures only.

Phase 2 roadmap includes Redis capture, httpx interception, and background Celery integrations.

Metadata

Release files for incident-replay 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for incident-replay 0.1.0
File Size Uploaded Provenance
incident_replay-0.1.0.tar.gz 12.1 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for incident-replay 0.1.0
File Interpreter ABI Platform
incident_replay-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 25.4 kB

Release files / incident_replay-0.1.0.tar.gz

Download URL incident_replay-0.1.0.tar.gz
Size 12.1 kB
Tags Source
SHA-256 checksum
How to use checksums
6eecffd6abf7183e16a19441ab8c5c29aa51e9c4fdc64d8f192445b75028b8f0
BLAKE2b-256 checksum
How to use checksums
238821430776e11627a37749e056d3a37d45c20f0fc597e24ac1cbf6f046eb3d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.12

Release files / incident_replay-0.1.0-py3-none-any.whl

Download URL incident_replay-0.1.0-py3-none-any.whl
Size 13.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
27ff99ff8913ef8068c30abd661d9b0143fb4092979c4fd61fd482bec0e7ecc1
BLAKE2b-256 checksum
How to use checksums
d5cb7f3e24a66ebc087560b8f52d5d03cfa018ce0a467942d0c2425fb452f1b4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.12

Security for incident-replay 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page