Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Redline

redline-core

The framework-agnostic engine behind Redline, a self-hosted request profiler and backend analyzer and load tester for Django, FastAPI, Flask and Litestar.

redline-core holds everything that does not depend on a web framework:

  • the trace/span data model and a contextvars recorder that follows async tasks and explicitly propagated thread contexts; ordinary new threads need explicit context propagation;
  • SQL fingerprinting, project-only callsite capture and secret redaction;
  • detectors for N+1 queries, duplicate queries, slow queries and query budgets, plus event-loop blocking, long transactions, huge and unbounded results, len(qs) vs .exists(), slow serializers and slow, duplicated or retried external calls;
  • an on-demand EXPLAIN runner with plan analysis for PostgreSQL, MySQL, SQLite and SQL Server (with documented driver limits);
  • an optional pyinstrument flamegraph profiler (redline-core[profile]);
  • a separate SQLite store with a background writer, retention, hourly rollups and release history;
  • a load tester (redline load, extra load) with an open-model scheduler, knee detection and per-step bottlenecks;
  • a refactor check (redline check, extra load): record a baseline of read-only requests, compare a new version, per-endpoint verdicts on responses and speed, JUnit and Markdown output;
  • optional integrations in redline_core.contrib (SQLAlchemy, httpx, requests, redis, asyncpg, psycopg, Marshmallow, Strawberry, Graphene);
  • the access policy and layered configuration shared by every adapter;
  • the framework-neutral JSON API and the prebuilt web UI.

It has no runtime dependencies.

You probably want an adapter

Install the package for your framework; it pulls in redline-core for you:

Published adapters are available on PyPI and pull in the matching core automatically. Choose django-redline, fastapi-redline, flask-redline or litestar-redline:

pip install --pre django-redline

This checkout describes the next v0.4 release. PyPI behavior depends on the installed version; unreleased changes require a local source installation.

Extras on the core requirement: profile (flamegraphs), load (the load tester), and httpx, requests, redis, asyncpg, psycopg, strawberry, graphene. Documentation: https://pythondeveloper6.github.io/redline/.

Timing your own code

import redline_core

@redline_core.span("pricing.compute")
def compute_price(order): ...

async def handler():
    async with redline_core.span("fetch-rates", kind="custom", provider="ecb"):
        ...

span() does nothing (and costs almost nothing) outside a recorded request.

v0.4 real-world workflows

The next release adds:

  • Handled SQL failures with vendor/SQLSTATE/native-code classification, raw rowcounts, failed-attempt counts and stable issue groups, even when the application returns HTTP 200.
  • SQL Server estimated plans, guarded actual-plan collection and catalog candidates; explicit engine ownership, optional all-engine observation and observed session-state evidence.
  • Offline redline check-sql for supported raw-SQL Python shapes, JSON/JUnit reports, baselines, explicit compile checks and schema snapshots. Static checks are conservative.
  • Generic background jobs, stages, row outcomes, retries and optional Celery signals; a Jobs page and commit-before-failure evidence for investigating partial job completion.
  • SQL value policies, privacy profiles, route rules, request/user correlation and redaction preview.
  • Bounded capture, failure-safe observation, storage auditing, read-only worker-store browsing, and explicit sanitized OTLP summary export.

Use these to investigate a caught database error, a migration that broke raw SQL, a worker that committed before failing, an N+1 endpoint, or a performance refactor whose responses must remain equivalent. The UI exposes SQL evidence, jobs, offline SQL checks and privacy preview alongside the existing timelines, plans, profiles and refactor reports.

For production choose the record-and-inspect preset, private storage and authenticated access. Replay, load/refactor runs, source analysis and database plan execution are disabled by default there. Live MySQL/SQL Server drivers, broker/prefork behavior and the intended filesystem/deployment must be qualified before rollout; fixture tests do not establish compatibility with every codebase.

See the detailed workflow guide, production guide and feature catalog.

Please test Redline on a real development or staging project and open an issue for bugs or feature requests. Include framework/database/driver versions and a small sanitized reproduction. Never post credentials or private recordings; follow the security policy for vulnerabilities.

License

MIT

Metadata

Release files for redline-core 0.5.0b1

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

Source distribution (sdist)

Source distribution for redline-core 0.5.0b1
File Size Uploaded Provenance Actions
redline_core-0.5.0b1.tar.gz 858.7 kB With provenance Details for redline_core-0.5.0b1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for redline-core 0.5.0b1
File Interpreter ABI Platform Actions
redline_core-0.5.0b1-py3-none-any.whl Python 3 none any Details for redline_core-0.5.0b1-py3-none-any.whl

Total release size: 1.6 MB

Release files / redline_core-0.5.0b1.tar.gz

Download URL redline_core-0.5.0b1.tar.gz
Size 858.7 kB
Tags Source
SHA-256 checksum
How to use checksums
1d597caea715f65cf307c4944b9d474b8e9983d0c30a874bdc8c259f157123a6
BLAKE2b-256 checksum
How to use checksums
a31466ed3abb274abfe9237ec9afd03d256f325a0a910ac83047fc8f66d144f5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 13, 2026.

Transparency log

Release files / redline_core-0.5.0b1-py3-none-any.whl

Download URL redline_core-0.5.0b1-py3-none-any.whl
Size 721.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8b6338fbda1c750d45fed11fa59466356d72f7e82b9deecaed17c3340dd414f0
BLAKE2b-256 checksum
How to use checksums
a88c92dbb94d4febe58e2337a500cc7375cee261f4dafdc095272eff80dba4a2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 13, 2026.

Transparency log

Security for redline-core 0.5.0b1

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for redline_core-0.5.0b1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 13, 2026.

Transparency log

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.

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