Skip to content

Changelog

All notable changes to the packages in this repository (redline-core, django-redline, fastapi-redline, flask-redline and litestar-redline) are documented here. They are versioned and released in lockstep.

The format follows Keep a Changelog, and the project adheres to Semantic Versioning. While the version is below 1.0 the public API may change between minor versions.

0.5.0b2 (2026-11-26)

Added

  • redline load init ends a TOML scenario with a commented-out example of the optional keys ([auth], [[flows]], extract, expect, max_ms, think_s, own_connection). Uncomment a line to use that key.
  • redline instrumentation lists each loaded raw DB-API driver as dbapi:<driver> and shows whether instrument_dbapi wraps it, so raw-cursor SQL that is not recorded shows up as a blind spot. These rows never trigger the auto-instrument warning.
  • instrument_client_method (and its context-manager form client_span) wraps one method of any client as a client span, recording kind, operation, target, duration, payload size and error. New opt-in integrations built on it: pymongo, Kafka (kafka), pika, Google Cloud Storage and Azure Blob Storage. auto_instrument covers them.
  • An unattributed_time detector flags a web request when no span covers at least unattributed_time_ms (100 ms) and at least unattributed_time_ratio (half) of its time. On a load run, that uncovered time appears as an other row in the bottleneck table.
  • redline_core.contrib.threads.instrument_threads() runs ThreadPoolExecutor.submit (so map and run_in_executor) and Thread.start in a copy of the request's context. Their SQL and outbound calls stay under the request, and each span carries the thread name in span.data["thread"]. Opt-in only; uninstrument_threads() undoes it.
  • Load runs can span several generator hosts. redline load agent runs workers for a controller (redline load ... --agents https://gen1:7700,https://gen2:7700); the controller sends each agent its share of one global step plan and a shared start time (clock offsets are measured), merges the agents' per-second histograms exactly like local workers', and reports generator CPU per step, marking a step generator_limited when a worker was above 90% of a core. Agents need a token, support TLS and target allow-lists, and never run a token command.
  • A flow can model a user: think_s (a number or [min, max] range) pauses between its steps and own_connection gives each session its own connection. Each step reports the peak number of sessions in flight, so 20 arrivals per second with 5 s of think time shows about 100.
  • Load requests are timed to the first byte as well as the last (ttfb_p50_ms / ttfb_p95_ms per step and in the summary). type = "stream" holds a server-sent-events or chunked response open for hold_s and counts events; type = "websocket" (extra redline-core[load-websocket]) connects, sends scripted messages, times the replies and holds the connection. Each step reports how many were open at once. Browser traffic can be grouped per page load with a page=<id> part in X-Redline-Run (GET api/runs/{id}/pages).
  • The MCP server (redline mcp) now covers the whole package, so an agent can run a full performance investigation. New tools: list_load_runs, get_load_run, load_run_summary (flows, recovery, drift, identities, limiting resource, resources), load_run_bottlenecks, load_run_metrics; validate_scenario and generate_scenario_from_openapi / _traces / _stages (scenarios are parsed or built, never run); analyze_sql_plan (a pasted SQL Server plan), database_capabilities, lint_sql, scan_sql_source, scan_sql_project, analyze_source, analyze_project, doctor, check_report, check_findings, fix_prompt, diagnose_preview; and list_traces, list_endpoints, compare_traces, search_sql, index_advice, cache_summary, external_summary, job_summary, history, compare_periods, list_releases.
  • Tools that change state are opt-in: start_load_run and stop_load_run need redline mcp --allow-load --load-target URL (the target is fixed by the operator and one run at a time is allowed), delete_load_run needs --allow-delete-runs. Without the flags they are neither listed nor callable.
  • MCP tool arguments are checked against each tool's JSON schema (types, enums, ranges, lengths); results are bounded, and credentials in URLs, token-like values, header, cookie and identity values are masked.
  • A load run reports which resource ran out. While a registered run sends it traffic, each app worker samples its own CPU, memory, GC pauses, threads and connection pool once a second (run_metrics, off in the production preset); the run summary carries resources per step and a limiting_resource verdict ("connection pool exhausted (5/5 checked out), wait time 40x"), printed by the CLI and served by GET api/runs/{id}/metrics. metric_sources (package.module:function) pull in numbers from a database or host monitor per step.
  • A stages load profile (--stages 10:1m,200:30s,10:3m) describes spikes, soaks and any custom shape. A step where the rate falls no longer decides the knee; the run summary reports how long p95 took to return to its pre-spike level (recovery) and checks long steps for slow growth in p95 and error rate (drift, drift_verdict of stable or degrading).
  • SQL Server plan and index tools check their permissions first. A one-time probe reports estimated_plan, actual_plan, index_usage and object_definitions as granted, missing (with the exact GRANT) or unknown (GET api/database/capabilities, redline doctor); a plan request that hits a missing permission answers 403 explain_permission with the grant instead of a raw driver error. The new explain_url setting runs plans on a separate login, POST api/explain/plan analyses a pasted XML plan without touching a database, and index suggestions list their evidence and lose a confidence level when catalog visibility is partial. Managed-instance differences are documented.
  • N+1 findings in raw SQL (text() or driver SQL) get a real rewrite instead of a hint: a diff at the callsite that replaces the per-row SELECT with one IN query over all the keys, chunked to the database's parameter limit (stated per vendor) and grouped back by the key, with the join alternative named when the parent query is in the trace. Dynamic statements get the batched statement as a code block.
  • Load scenarios can run journeys and check responses. [[flows]] chain requests: a step extracts a value (a JSON path, a header or a regular expression) and later steps use it as {var:name}; one arrival starts one flow, a failed step ends it and counts once, and the run summary and CLI report each flow and step (traces carry flow and fstep tags). expect rules and max_ms on any request turn a 200 with an error body, an empty list or a slow success into an assertion failure instead of a success.
  • GET api/runs/{id}/bottlenecks?identity=NAME splits the bottleneck table per load identity.
  • Load scenarios can vary the offered load. identities / identities_file give many users (round_robin, random or sticky, ${VAR} for secrets, only the name is recorded as the identity trace tag and in the run summary); [[data]] files fill {data:source.column} in paths, headers and bodies (sequential, random or zipf); [auth] gets a token from a command, a request or a Python callable and refreshes it before it expires, stopping the run with a clear error when a refresh fails. Every key is optional, so existing scenarios run unchanged, and redline load init writes them (--data-dir, --identities-file).
  • redline load --store-url postgresql://... writes the run to the shared PostgreSQL store, and the project's storage_url setting is used when --store is not given, so a load generator on another host fills the same bottleneck table as the application. The URL's password is never printed.
  • Requests tagged with a registered, running load run are kept even when sample_rate would drop them (sampled_by="run"), so low-rate steps still fill the bottleneck table. A made-up run id keeps nothing.
  • redline load can check, before the first step, that the application records the run: one tagged GET (step=probe) and a lookup of its trace, with the likely causes when nothing appears. On by default with --store-url / --register-url (warns), opt-in with --probe for a file store so existing runs send no extra request; --require-recording stops the run, --no-probe skips it.
  • Load runs started from the UI work on the shared PostgreSQL store. The background process gets the URL through the environment, and stopping a run whose process is gone closes it as failed.
  • A generator with no shared store registers its run over HTTP: redline load --register-url https://app/_redline (token from REDLINE_TOKEN or --token-file). The application accepts it only with the new accept_remote_runs setting (off by default and in every preset) through POST api/runs/register, .../steps and .../finish; it re-masks the config, validates every field, and only a run registered this way can be changed this way (never a run written by a local process).
  • SQL sent through a raw driver cursor is recorded. engine.raw_connection().cursor() on an instrumented SQLAlchemy engine returns a recording proxy, and redline_core.contrib.dbapi.instrument_dbapi(module) does the same for a driver used with no engine (sqlite3, psycopg2, pymysql ...). Spans carry source="raw_cursor"; an executemany is one span with a batch_size. SQLAlchemy's own use of raw_connection is not double-counted.

Security

Findings of the security review of this release, all fixed in the same branch with regression tests:

  • MCP start_load_run now accepts only an allow-list of scenario keys. It previously refused only some local-only keys, so auth (a command or Python token provider), identities and flows could reach the detached load process.
  • A remote agent no longer trusts a worker config beyond what it documents: unknown keys are refused; data must be inline rows (no file read); identities must be resolved (no ${VAR} environment expansion on the agent); the token endpoint is checked like the target; sizes are bounded.
  • Agent target checks resolve names and check every address (decimal and hex IPs, trailing dots, IPv4-mapped IPv6, fd00:ec2::/32, DNS names pointing at metadata services), and --allow-target matches scheme, host and port exactly on a path boundary (no http://app.internal.evil.com or http://app.internal@evil.com). Agent tokens need 16 characters, connections time out, and a hostile body is a 400, not a crash.
  • Histogram decoding is bounded (a small zlib bomb sent to POST api/runs/{id}/steps could inflate to hundreds of MB and spin for seconds); buckets must be strictly increasing.
  • An invented X-Redline-Run id is no longer queued as a provisional trace nor looked up in the store: the recorder asks a cached known-runs set.
  • Remote registration is bounded: at most 50 running registered runs, step numbers up to 1000, and metrics only for a run that is still running.
  • Secrets: explain_url and other URLs mask odbc_connect, pwd, uid and password query values; the stored run config masks the token endpoint URL and WebSocket messages; generator errors and the "open the run" line hide URL credentials; the CLI warns about plain http to a non-loopback agent or registration URL.
  • MCP report tools read only files inside the working directory, and scenario validation errors no longer echo the offending value.
  • GET api/database/capabilities follows the explain feature switch, validates the alias and bounds its cache.
  • A run registered over HTTP is no longer marked failed by the dead-process check on stores that once launched a UI run.
  • Check-run cleanup removes the private configuration containing raw request headers before deleting the PID completion marker, so observers cannot see a finished run while its secrets remain on disk.
  • A stray .bak file was removed from the package source.

0.5.0b1 (2026-11-12)

The project moves from alpha to beta.

Added

  • Every finding explains itself: GET api/issues items carry why (rule, observed, threshold, grouping, limits), shown as Why this fired on the Issues page.
  • GET api/issues?sort=impact and a Fix impact (sampled) ordering rank findings by sampled observed time. Impact is labelled sampled and never additive.
  • redline check verify REPORT --kind KIND answers whether a fix removed a finding (gone, still_present, inconclusive), whether responses stayed equal and whether the request got faster. gone needs enough after-change samples and complete metrics.
  • redline check compare-live SUITE --old URL --new URL alternates requests between two running versions (order flips each round) to reduce timing drift.
  • Latency budgets accept min_samples; with fewer timed calls they fail as "insufficient samples" instead of judging a meaningless p95.
  • redline instrumentation, GET api/instrumentation and a Settings card report what redline cannot see: inactive integrations, truncated traces, traces without a profile and dropped or failed writes.
  • scripts/check_metrics_loop.py repeats record-then-compare against the FastAPI demo to look for the intermittent "server-side metrics: unavailable" report.

  • AI-agent support: redline mcp serves read-only tools (list_issues, explain_issue, get_trace, instrumentation_report, verify_fix, llm_summary) over MCP on stdio with no new dependency and an optional audit log of tool names and argument keys.

  • redline fix-prompt ISSUE_ID writes a brief an agent can act on; redline check findings REPORT [--new-only] lists a report's findings with a brief each.
  • redline agent-skill [--format skill|agents] [--write DIR] emits the Claude skill and an AGENTS.md section. docs/llms.txt, docs/llms-full.txt, docs/reference/settings.schema.json and docs/reference/cli.json are generated by scripts/build_llms.py; CI fails when stale.
  • LLM-call observability: instrument_anthropic() and instrument_openai() record llm_call spans (provider, model, token counts, status, a prompt hash and size; never prompt or completion text). New findings duplicate_llm_call, serial_llm_calls, llm_in_transaction, llm_call_loop and uncached_large_prompt, settings llm_duplicate_threshold, llm_serial_min, llm_loop_calls, llm_prompt_cache_chars, and GET api/llm for sampled token usage per route and model. No price table is shipped.
  • Opt-in AI diagnosis: redline diagnose ISSUE_ID previews the exact request and sends nothing. --send needs --send, ai_diagnosis = true and REDLINE_AI_API_KEY together (settings ai_diagnosis, ai_provider, ai_model).
  • The FastAPI demo gains GET /assistant (LLM-call findings without a key or network), a .mcp.json and an AGENTS.md.
  • instrument_client_method and client_span (redline_core, redline_core.extending) record a call to any client library as a span with client, operation, target, duration, payload size and error class, so a database, queue or storage client without an integration is no longer invisible. See "Instrumenting a client" in docs/extending.md.
  • First-party, opt-in integrations built on it: instrument_pymongo(), instrument_kafka() (kafka-python KafkaProducer.send), instrument_pika() (basic_publish), instrument_google_cloud_storage() and instrument_azure_blob(). Each imports its library lazily, returns False when it is missing, never records payloads, object names or error messages, and is covered by auto_instrument and redline instrumentation.
  • New finding unattributed_time: a Django, FastAPI, Flask or Litestar request with at least unattributed_time_ratio (default 0.5) of its time, and at least unattributed_time_ms (default 100), covered by no span. It names the profiler's project frame when the trace has a profile. Wrapper spans (view, middleware, transaction) do not count as coverage; jobs and traces with dropped spans are skipped.
  • Load runs: api/runs/{id}/bottlenecks gains an item of kind other (key other:uncovered) with the per-request time no span covers, per step. Existing sql and route items are unchanged.
  • instrument_threads() (opt-in, reversible with uninstrument_threads(), idempotent) copies the request context into ThreadPoolExecutor.submit and Thread.start work. SQL and other spans recorded on worker threads stay under the request and carry the thread name in span.data["thread"]; spans from concurrent threads are recorded safely. Work that outlives the request is not recorded. Listed as threads in redline instrumentation, never enabled by auto_instrument.

Changed

  • Development status classifiers are now 4 - Beta.

Security

  • Finding explanations echo only finite numbers from detector evidence, never free text, so a hostile string in evidence cannot reach the Issues page through Why this fired.
  • Agent surfaces are read-only by construction. Prompt text never reaches spans, issues, the API, fix briefs, MCP output or the diagnosis preview (an end-to-end test with a secret prompt covers each). The MCP server answers oversized, malformed and unknown requests with errors and keeps serving; its audit log stores no argument values and is created with mode 0600.
  • AI diagnosis sends only an allowlisted, redacted set of finding fields to a fixed provider host, reads the key from the environment only (never a setting, never printed), and reports HTTP status without the response body or key.
  • Regression tests cover credential gating of api/instrumentation and api/issues, no redirect following in check compare-live, and rejection of non-report files by check verify.

0.5.0a2

Added

  • redline doctor --production --strict --json checks a recording-only deployment policy without changing configuration. Warnings fail strict checks; JSON remains machine-readable when configuration cannot load.
  • Authenticated GET api/health exposes process-local recorder/storage health without querying the trace database. Meta/Recording health also show queue pressure, capture failures, write/flush/shutdown failures and reason-specific dropped-item counters.

Fixed

  • Serialize save admission with shutdown so accepted traces cannot land behind a stop marker. Bounded close returns a completion result and reports discarded queued work.
  • A timed-out shutdown leaves an active writer's connection alone; the writer closes it after draining/stopping. Flush no longer reports success for abandoned queued work.
  • Writer startup can retry after thread-start failure. Writer/logging failures preserve later recording attempts, and counters are protected and reset for a forked process.
  • Internal API exception messages are withheld when error-detail capture is disabled.

Added (production readiness)

  • Shared PostgreSQL trace store (PostgresStore): set storage_url / REDLINE_STORAGE_URL to a postgresql:// URL (install redline-core[postgres]) so several workers and hosts write one store, with the same pages, aggregates, retention and background writer as SQLite; schema-versioned, serialized across processes, fork-safe.
  • redline doctor --strict and --workers N: doctor warns (fails with --strict) when several worker processes share one SQLite file (detected from WEB_CONCURRENCY, GUNICORN_CMD_ARGS or UVICORN_WORKERS), and checks the driver and connection of a storage_url store.
  • engines="auto" for Flask Redline, FastAPI install and Litestar RedlinePlugin captures SQLAlchemy engines created at runtime (per user or per request, e.g. token-authenticated SQL Server connections); EXPLAIN works on auto-found sync engines.
  • Stored procedures are a query kind: EXEC/EXECUTE, CALL and ODBC {CALL ...} spans carry query_kind: "procedure" and the procedure name, and fingerprint per procedure.
  • ignore_sql setting (regular expressions); the default skips sp_set_session_context and SET ... session housekeeping.
  • Flask requests carry a blueprint trace tag; GET api/endpoints?group_by=blueprint (or tag:<key>) and flask redline endpoints --group-by blueprint aggregate per blueprint.
  • Composite GitHub Action (uses: Pythondeveloper6/redline@<ref>) and redline check comment: job summary plus one sticky pull-request comment.
  • install_if_dev in every adapter (and redline_core.environment): refuses to attach when the environment looks like production; REDLINE_ALLOW_PRODUCTION=1 overrides.
  • redline init: detects the framework, writes a starter redline.toml (or --pyproject) and adds the store directory to .gitignore.
  • redline check ratchet and pytest --redline-ratchet / --redline-ratchet-update: per-endpoint query-count and latency baselines that only tighten.
  • redline_core.correlation: a redline_trace_id logging filter and a Sentry before_send hook with an "Open in Redline" link; OTLP spans carry redline.trace_id.
  • redline export ID --html OUT: one self-contained, redacted HTML summary of a recording or load run.
  • redline digest: posts newly seen issues to a Slack-compatible webhook, deduplicated through a state file.
  • GET api/metrics (Prometheus text format) for recorder health; SQLiteStore.health() counts drops by reason and write failures.
  • auto_instrument setting (off / warn / on, default warn): warn once about, or instrument, installed httpx/requests/Redis/boto3.
  • RQ (redline_core.contrib.rq) and Dramatiq (redline_core.contrib.dramatiq) job recording with trace-context propagation (rq and dramatiq extras); FastAPI/Starlette BackgroundTasks are recorded as jobs linked to the request trace.
  • check-sql resolves more dynamic SQL (%, .format, join of literals, +=, straight-line local reassignments) and reports unresolved_by_reason and a per-item category.
  • scripts/measure_static_precision.py and a labelled corpus measure static-analysis precision, recall and false-positive rate, also on your own reviewed findings.
  • Live MySQL qualification (EXPLAIN, index advice, killed connections, pre-ping) with pymysql, aiomysql and asyncmy, a mysql CI job, and a SQL Server per-request engine test in the Compose suite.
  • Compatibility workflow: fresh-venv installs from PyPI and from built wheels (scripts/check_clean_install.py), and stores written by every published release opened by the current code (scripts/check_store_upgrade.py).
  • scripts/run_tests.py runs every package suite from the repository root; benchmarks/real_app.py measures p50/p95 overhead on a running application over HTTP.
  • Documentation pages: API stability and deprecation policy (docs/api-stability.md), threat model (docs/threat-model.md) and operating Redline (docs/operating.md).

Changed (production readiness)

  • Installing an adapter with httpx, requests, Redis or boto3 present but uninstrumented now logs one warning (auto_instrument = "off" silences it).
  • A stored-procedure call's fingerprint no longer includes its arguments (EXEC dbo.usp_x); N+1 detection groups procedure calls and duplicate procedure calls are reported as info.
  • A SQLite store on a network filesystem fails redline doctor --strict (still a warning by default), and the message recommends the shared PostgreSQL store.
  • Adapters build their default store with redline_core.storage.store_from_settings; SQLiteStore.from_settings returns the PostgreSQL store when storage_url is set.
  • REDLINE_ENV and REDLINE_ALLOW_PRODUCTION are no longer reported as unknown settings.
  • Public API is defined in docs/api-stability.md; the internal design contract and planning files left the public tree.

Security

  • access="framework" with no dependencies or guards attached now refuses every request in the FastAPI and Litestar adapters, as Flask and Django already did (it previously allowed everyone).
  • Free-text redaction (bodies, logs, error messages, locals) runs in linear time; crafted input could previously cost seconds of CPU per request. Error, header and identifier texts are cut before they are scanned.
  • Redaction also masks a bare token used as a URL user name; the default secret key names now include access keys, signatures and credentials.
  • The EXPLAIN safety check reads MySQL # comments, so a quote inside one can no longer hide a second statement or a locking clause.
  • redline check comment sends the GitHub token only over https (plain http only to loopback), never follows redirects, caps API answers and validates the repository name.
  • OpenAPI downloads for redline load init are size-capped and follow redirects only to http(s).
  • The OTLP export redacts issue titles and the raw SQL included with --include-sql.
  • The login rate limit counts IPv6 clients per /64 and keeps blocked clients when its table is full; Basic authentication takes the same time for unknown and known user names.
  • Internal-error API answers redact the exception text.
  • Store side files, run files and redline export --html pages are created 0600 and are never written through a symlink.
  • A PostgreSQL store URL is masked correctly when the password contains /, ? or #.
  • CI and the GitHub Action: third-party actions pinned to full commit SHAs, checkouts do not persist credentials, Pages/OIDC permissions limited to the deploy job, matrix values passed through the environment, and the action's extra-args is never glob-expanded.
  • A curated set of flake8-bandit rules is enforced by ruff.

Fixed (production readiness)

  • Tests no longer use the deprecated starlette.middleware.wsgi (now a2wsgi).

0.5.0a1 development baseline

Added

  • Bounded project import summaries detect repeated query helpers across scanned Python modules, including explicit aliases, relative imports and stable package re-exports.
  • SQLAlchemy session inference covers Optional/Annotated/string annotations and known sessionmaker/async_sessionmaker factories and context-manager bindings.
  • Offline SQL checks recover stable text-clause constants, safe literal-return SQL template helpers and imported literal constants, without importing application code. ORM expressions remain explicitly unvalidated and require capture/compilation.
  • Optional boto3 SDK operation spans capture service, operation, status and duration without storing SDK arguments, response bodies, bucket names or object keys.
  • fastapi_redline.add_background_task records sync/async in-process tasks as distinct jobs with parent correlation. Argument/result capture and exception details are suppressed for these jobs; original task exceptions and execution scheduling are preserved.
  • Recording health reports installed/loaded/instrumented optional integrations and explains that hook status is not evidence of observed activity.

Fixed

  • Split UI pages into lazy chunks while keeping navigation and palette destinations available.
  • Disable URL-based module preloads so embedded offline snapshots can load lazy chunks from their data-URL import map; verified against a real Safari-rendered export.

0.4.0a2 development baseline

Fixed

  • Source analysis respects loop evaluation order: a query producing the outer iterable no longer becomes a query-per-row warning. Queries in bodies and nested iterables remain candidates.
  • SQLAlchemy Session.get and scalar are recognized without flagging ordinary dictionary lookups.
  • Query-loop guidance includes SQLAlchemy batching and loader options and warns about identity-map hits, conditional queries and intentional batching.
  • Event-loop samples without a project frame no longer name an outer runner as the culprit. Sampled SQLAlchemy work no longer implies a synchronous driver; confirmed driver spans keep their specific advice.

Added

  • Same-module query helper summaries, following up to eight helper edges, expose repeated calls hidden behind local helpers. These remain syntax candidates requiring runtime review.
  • Explicit --max-files and --max-project-bytes budgets for analyze and check-sql, capped at 10,000 files and 64 MB. UI/default budgets stay at 200 files and 2 MB.

0.4.0a1 development baseline

Added

  • SQL failure recordings and issue groups, raw rowcounts, comment-placeholder findings, connection lifecycle evidence and observed session-state checks for SQL Server isolation, IDENTITY_INSERT, value switches, session context and PostgreSQL/MySQL session state. A SQL retry-storm finding groups repeated attempts after a transient failure, and lifecycle gauges persist in hourly history even when sampling drops the trace.
  • SQL Server identity, estimated/opt-in actual XML plan collection, logical-read summaries and bounded catalog inspection. Live driver validation remains required.
  • Offline redline check-sql, explicit online compilation and schema snapshots, bounded store auditing, import checks and explicit sanitized OTLP export of SQL spans and issue log records. SQL Server online checks use server-described parameter types and result columns under NOEXEC, and flag literal row reads the described SELECT no longer returns. Snapshots include SQL Server triggers and routine parameters, and schema drift recompiles only statements that reference affected tables. redline schema-watch polls the comparison, writes a baseline on its first run and can persist a schema_drift issue without running migrations. Unused-index analysis covers SQL Server's usage DMV, and repeated raw text() SQL gets a batching hint when no ORM relationship matches.
  • redline doctor now runs a real WAL self-test beside the store and warns on Linux network/virtual mounts; two independent OS processes are tested writing one SQLite file. The SQLAlchemy query path avoids repeated bounding/classification work on ordinary rows.
  • The overhead benchmark has an mssql cell driven through a fake pyodbc-shaped DBAPI.
  • redline check-imports follows statically visible imports inside task functions after loading each task module, and redline check compare/run --ruff includes Ruff JSON in Markdown and JUnit without becoming a linter.
  • Generic jobs/stages/row outcomes, optional Celery signals, retry outcomes and commit-before- failure evidence; Jobs, SQL checker and redaction-preview UI surfaces. Jobs record the first failing stage and GET api/jobs/summary aggregates outcome, latency and stage counts for retained task recordings.
  • Shared-dev defaults, SQL value capture policies, privacy profiles and route rules, log filters, user/request correlation, read-only secondary trace browsing and nested Flask/FastAPI recording.
  • pytest SQL-error/session-state assertions and --redline-all.

Changed

  • Failed SQL attempts remain visible even when application code catches the exception.
  • SQL observers preserve application results and original errors when capture fails; recorder ownership isolates engines shared by several applications.
  • Bounded SQL/parameters, span data, tags and complete trace payloads; production capture uses smaller budgets, value-free diagnostics and safe metadata on privacy failure.
  • Duplicate trace IDs across secondary stores are marked and cannot select unrelated evidence.
  • Routine CI and docs deploy only after pushes/merges to main; no PR-triggered runs.
  • All five distributions move together to 0.4.0a1. See Real-world workflows for support boundaries and the local validation report before publishing.

0.3.0a1

The refactor check: prove a refactor is safe and measure what it gained. A 0.2 store is migrated in place to schema version 4 when 0.3 first opens it.

Added

  • Performance workflow UI: endpoint budgets, keyed JSON arrays, numeric tolerances, environment labels and observed target runtime warnings, suite coverage, source analysis, recording health, scoped suppressions and issue-to-check verification.
  • Deterministic findings for repeated writes/aggregate scans, deep OFFSET pagination, cumulative round trips, pool waits, response/cache size, ORM instance construction and explicitly measured cache decoding; sampled JSON decode hotspots and on-demand catalog checks for wide columns, covering indexes and matching generated JSON expressions.
  • redline analyze and a pytest plugin, with query/outbound-call/issue assertions, explicit no-query blocks and UI-inspectable test traces. See Performance workflows in the docs.
  • Real /patterns demo endpoints and clearly marked synthetic detector examples for UI exploration; synthetic timings are not treated as measured application traffic.

  • Refactor check (redline_core.check). A suite of read-only requests (TOML or JSON, or built in the UI) is replayed against the old code to make a baseline and against the new code to make a comparison. Per endpoint: a response verdict (same, changed, broken, with a JSON path or unified text diff that skips fields that change on every call) and a performance verdict (faster, slower, same, noisy; Mann-Whitney U test at p < 0.01 plus percentage and millisecond thresholds, interleaved requests, warmup, and a query-count rule). Server-side query counts, SQL and new or fixed issues come from the app's own traces. See Refactor check.

  • CLI: redline check record, compare, run, init --from-traces and show; --json, --markdown and --junit outputs; --fail-on (slower, changed, broken, noisy, faster, none); exit codes 0, 1, 2, 3 (app unreachable) and 130.
  • HTTP API: api/checks/suites (list, create, get, update, delete, TOML export, draft from seen traffic), api/checks/runs (start, list, get, stop, delete) and api/checks/baselines/import. New error codes invalid_suite, invalid_baseline, checks_from_ui_disabled, suite_not_found, check_run_not_found, payload_too_large; run_active also covers check runs.
  • UI: Checks pages (suites, builder, suite, report with latency, response diff, new and fixed SQL and issues, live progress, copy as Markdown).
  • Settings: checks_from_ui ("auto" by default: debug mode only) and the checks feature switch.
  • Storage: schema version 4 with check_suites, check_runs and check_results; the 50 newest runs per suite are kept.
  • The X-Redline-Check request header tags traces with check_run_id, check_req and check_n.

Changed

  • Refactor check: a request whose response is broken is no longer judged for perf (verdict n/a, reason broken, "perf not judged: response broken"); its fixed issues, gone SQL and query decrease are not reported as wins and it is left out of the overall speed and the query totals.
  • Refactor check: requests that the baseline does not have get the response verdict missing, which fails by default (--fail-on now defaults to slower,changed,broken,missing) and adds a warning and summary.missing to the report. A baseline that has none of the suite's requests is an error (exit 2; in the UI the run fails with the same message).
  • redline check init writes base_url only when --base-url is given or the traces show a single host; otherwise a commented # base_url = ... line.
  • UI: a stopped run shows its partial results labelled "partial: stopped after N of M calls", or "No results were kept", never both. The suite page can import a baseline file (up to 10 MiB), which then appears in the baseline picker.
  • The production preset sets checks_from_ui = false.
  • The Django, FastAPI, Flask and Litestar adapters pass PUT bodies to the API and accept request bodies up to 11 MiB on api/ routes (Django reads past DATA_UPLOAD_MAX_MEMORY_SIZE after the access check; Litestar 2.13 or later gets request_max_body_size), so a large baseline can be imported.
  • Tagged check traffic is kept when sampling would have dropped it, but only for a check run that is known to the store.

Security

  • Starting a check from the UI is opt-in (checks_from_ui), refused in read_only mode and when the checks feature is off. Suites accept only GET, HEAD and OPTIONS, and paths only (no absolute URLs); UI runs are capped at 200 requests, 5 000 calls and 15 minutes.
  • ${env:NAME} placeholders in suite headers are never expanded in anything stored or exported; secret header values are masked in stored suites and API responses; baselines are redacted on write and on import.
  • The X-Redline-Check tag cannot force storage: it is honoured only for a run that exists in the store and is running (or ended less than a minute ago); otherwise its check_* tags are stripped, and a request that sampling kept only because of the tag is dropped.

0.2.0a1 (2026-10-27)

Frameworks, analysis, load testing and history. Everything in 0.1 keeps working: a 0.1 store is migrated in place when 0.2 first opens it, and every new field has a default.

Added: frameworks

  • flask-redline: Redline(app, engine=...) and init_app, Flask-SQLAlchemy engines (binds included) found automatically, flask redline clear|prune|scan|scenario.
  • litestar-redline: RedlinePlugin(settings, engine, path, guards, store), picks up advanced-alchemy engines.
  • Django Ninja routes resolved to the real operation (view name and route template).
  • All adapters: Server-Timing header, floating badge, Server-Sent Events api/stream, snapshot download, X-Frame-Options: DENY on Redline's own responses.

Added: analysis

  • New detectors: blocking_in_async, large_result, unbounded_query, inefficient_count, slow_serializer, long_transaction, external_in_transaction, slow_external, duplicate_external, retry_storm.
  • New span kinds: serializer, resolver, transaction, blocking, pool_wait; SQL spans gain rows, has_limit, in_transaction.
  • An event-loop lag monitor and watchdog that name the blocking call, active only while a request is in flight.
  • Log capture per request (capture_logs, log_level, max_logs_per_trace) and exception frames with redacted locals (capture_locals).
  • GraphQL: Strawberry and Graphene resolver spans, with N+1 reported against the resolver path.
  • redline_core.contrib: SQLAlchemy (moved from fastapi-redline, which re-exports it), httpx, requests, redis-py, asyncpg, psycopg 3 and Marshmallow integrations.
  • Database page: SQL search by fingerprint, a workload index advisor and unused-index detection (GET api/sql, GET api/indexes).
  • Cache page (hit rate, unread writes, stampedes) and External calls page (latency, duplicates, retries) (GET api/cache, GET api/external).
  • Static N+1 scan of templates and DRF serializers (manage.py redline_scan, flask redline scan).

Added: load testing

  • redline load: an open-model, coordinated-omission-corrected load generator running in separate processes; constant, ramp and step profiles; Poisson arrivals; stop_on; knee detection; --fail-p95-ms and --fail-error-rate for CI.
  • redline load init --from-openapi | --from-traces to generate scenarios; Django and Flask scenario generators.
  • Runs are stored with per-step histograms and shown on the Load page with a per-step bottleneck analysis (GET api/runs, GET api/runs/{id}/bottlenecks).
  • Optional start-from-the-UI (load_from_ui, off by default). It sends only paths, to the base_url setting or a loopback / allowed_hosts address; capped at one hour, 5 000 rps and 200 steps; run statuses running, done, stopped, failed; stopping a run from any worker.
  • redline load --ui-url sets the Redline UI address printed after a run (default from mount_path, else /_redline).
  • The knee rule: the first complete step with p95 above 2x the first step's, an error rate above 1%, or an achieved rate below 90% of the target; partial steps never decide it.

Added: history

  • Hourly rollups with mergeable latency histograms, releases, an issue index that survives trace pruning, kept history_retention_days (default 90).
  • Release stamping (release setting; REDLINE_RELEASE, common CI variables, or git).
  • History page and GET api/history, api/releases, api/history/compare with regressed / improved / new / gone verdicts and new / resolved / persisting issues.

Added: UI

  • Command palette (Ctrl-K), keyboard shortcuts, Live mode, open-in-editor links (editor setting), copy as cURL / HTTPie, replay, compare two requests, Logs and Exception tabs, offline snapshots.

Added: configuration and access control

  • Presets dev, staging and production; redline.toml / [tool.redline]; REDLINE_* environment variables; layered precedence.
  • One access policy for all adapters: local, token, basic, framework, custom, open (needs REDLINE_ALLOW_OPEN=1); allowed_ips, allowed_hosts, trusted_proxies, read_only, per-feature switches, ui_enabled, mount_path, login with a scoped cookie and a rate limit.
  • Layers: defaults, adapter, preset, file, environment, framework. A native hook (Django staff check or PERMISSION, FastAPI dependencies=, Flask permission=, Litestar guards=) implies access = "framework". REDLINE_* values are parsed by type (bools, JSON or comma lists, k=v tables, none); an unknown variable or file key is an error with a "did you mean" hint.
  • Settings: preset, access, access_check, allowed_ips (widens local, restricts the other policies), allowed_hosts, trusted_proxies, token, token_file, basic_users, secret_key, read_only, features, ui_enabled, mount_path, session_ttl_s, max_login_attempts, base_url, trust_unix_socket, cookie_secure.
  • redline config, redline doctor, redline hash-password; GET api/config, POST api/login and POST api/logout (both answer 200 JSON), X-Redline-UI: 1; a login screen and a Settings page. Under token and basic the UI shell is public and every api/ call needs credentials. Sessions need secret_key with several workers.
  • Live mode resumes by seq (after= or Last-Event-ID); the stream closes after five minutes on ASGI and about 25 seconds on WSGI servers and the UI reconnects.
  • GET api/indexes returns candidates with kind, confidence, verified, plus already_indexed, explained, unused_error and cached; cached for 30 seconds, refresh=1 recomputes; unused indexes are PostgreSQL only.

Changed

  • Behaviour changes to know about when upgrading from 0.1:
  • FastAPI, Flask and Litestar: when access is not set anywhere (code, redline.toml, REDLINE_ACCESS) and the app is not in debug mode (app.debug), every Redline URL answers 404 and an error is logged at startup. A same-host reverse proxy that adds no X-Forwarded-For (proxy_pass http://127.0.0.1:8000;) used to make every visitor "local". Set access explicitly: "token"/"basic" on a server, or "local" to accept that risk on a development machine. In debug mode the local default still applies.
  • Under local, a unix-socket peer (no client address) is no longer local unless trust_unix_socket = true.
  • FastAPI install(dependencies=[]) and Litestar RedlinePlugin(guards=[]) are the same as not passing them (the normal default rules), no longer access = "framework" with nothing to check. A FastAPI dependency that returns False now refuses with 403 (raising HTTPException remains the normal way).
  • Django: the default PERMISSION is active superusers (was: active staff). Use "PERMISSION": "django_redline.conf.staff_permission" for the old rule.
  • X-Redline-Profile: 1 / ?_redline=profile are honoured only in debug mode or when the request carries valid Redline credentials (login cookie, Authorization header, or a client the local policy lets in); framework hooks cannot run there, so with that policy only debug mode forces profiling. The production preset sets profile = "off".
  • X-Redline-Run tags a trace only when the run exists in the store and is running (or ended less than a minute ago); a run started with redline load --no-store (or into another store) no longer tags the app's traces.
  • UI-started load runs target the server's own listening port (ASGI scope["server"], WSGI SERVER_PORT) on 127.0.0.1, never the Host header; without a known port (a unix socket) the base_url setting is required.
  • Replay sends no cookies unless "Send my cookies" is ticked.
  • server_timing now defaults to "auto" (on in debug mode only). It used to be on whenever recording was; set server_timing = True to keep the old behaviour.
  • Sec-Fetch-Site: same-site is refused on non-GET requests, like cross-site.
  • Under local, a loopback peer that sends X-Forwarded-For, X-Real-IP or Forwarded without being in trusted_proxies is refused (403 forbidden), so a reverse proxy on the same host no longer makes every visitor local.
  • POST api/runs needs the base_url setting unless the server's listening port is known (400 invalid_body otherwise).
  • FastAPI's install(prefix=), Flask's url_prefix and Litestar's path default to None (then mount_path, then /_redline).
  • Under token and basic the API needs credentials on every api/ call.
  • GET api/stream events carry an id (the trace's seq) and the server closes the stream periodically.
  • Log capture uses a log-record factory and follows your loggers' levels; Redline never adds a root handler or changes a level, and log_level is an extra minimum.
  • Replay refuses paths that point at another origin.
  • Storage schema version 3 (migrated in place from 0.1 or 2): saved_seq gives the live stream an insertion order; writes use BEGIN IMMEDIATE; requests that matched no route are filed as (unmatched) in the history.
  • The default redact_keys pattern matches auth / authorization only as whole words and also covers private_key.
  • Documentation is published to GitHub Pages.
  • The redline console script is installed with redline-core.

Security

  • New error codes for access and safety: login_required, invalid_credentials, read_only, load_disabled, feature_disabled, open_refused, too_many_requests.
  • Starting a load run from the UI accepts only paths, never a host, and a forged Host header can no longer aim it at another machine; UI-started runs are capped.
  • Access control: constant-time token and PBKDF2 password checks, signed HttpOnly, SameSite=Strict session cookies, a per-IP rate limit on failed credentials, and X-Forwarded-* believed only from trusted_proxies.
  • CSRF is enforced by one shared gate on every non-GET call, login and logout included.
  • Redaction: passwords in URL userinfo (user:password@host) and secret query values are masked in outbound URLs, log messages and exception locals; locals are masked in containers to a depth of four and through the free-text rule; secrets in a stored load run's config are masked.
  • Server-Timing is off outside debug mode by default, since it is a side channel.
  • An unset access no longer exposes Redline behind a same-host reverse proxy: outside debug mode the UI and API answer 404 until access is set (FastAPI, Flask, Litestar); unix-socket peers are not local unless trust_unix_socket. redline doctor warns.
  • Empty dependencies=[] / guards=[] no longer turn the gate into an unchecked framework policy; a FastAPI dependency returning False refuses.
  • Anonymous clients can no longer force profiling and storage with X-Redline-Profile / ?_redline=profile, nor attach traffic to a load run with a made-up X-Redline-Run.
  • A load run started from the UI can no longer be aimed at another loopback service through the Host header.
  • Replay no longer sends the viewer's cookies by default (a recorded request replayed with the viewer's session would be a stored CSRF).
  • The store directory Redline creates is 0700 with a .gitignore of *; the database, its -wal/-shm files and load-run files are 0600 (POSIX).
  • cookie_secure ("auto", true, false): "auto" sets Secure for https, including X-Forwarded-Proto: https from a trusted_proxies peer. Logging out revokes that session cookie in the process that answered (in memory until it expires). redline doctor warns when trusted_proxies is empty with token/basic (one shared login rate-limit bucket behind a proxy).
  • GET api/config masks userinfo in base_url.
  • Session ids and API tokens are no longer stored: cache keys after a session prefix (django.contrib.sessions.cache…, session:) or a secret-looking name are masked, and SQL parameters are masked when their table looks secret (DRF authtoken_token, django_session), inside function calls (crypt(%s, …)), in INSERT … VALUES, ON CONFLICT … SET and every item of an IN (…) list.
  • Exception messages, tracebacks (chained ones included) and frame source lines go through the free-text redaction rule, which now also masks JWTs, Luhn-valid card numbers and <key>value</key> elements.
  • Request capture: headers whose name looks secret (X-Auth-Token, X-CSRFToken, …) are masked; multipart bodies are parsed (secret fields masked, files reduced to [file: name, N bytes]); text, GraphQL and XML bodies use the free-text rule.
  • Secret route parameters (token, uidb64, key, signature, code, or a redact_keys match) are masked in the stored path, e.g. Django's /reset/[redacted]/[redacted]/; high-entropy segments of unmatched paths are masked too.

0.1.0a1

Initial alpha: request profiling, N+1 detection with fix suggestions, EXPLAIN analysis, flamegraphs, web UI for Django and FastAPI.

Security

  • FastAPI: the default local_only guard now also requires a loopback Host header (localhost, *.localhost, 127.x.x.x, [::1]), closing a DNS-rebinding read of the GET endpoints. loopback_guard(allowed_hosts=[...]) allows other names.
  • Django: Redline's views call request.get_host(), so ALLOWED_HOSTS is enforced on them without CommonMiddleware.
  • EXPLAIN: is_explainable now refuses every row-locking clause (FOR SHARE, FOR NO KEY UPDATE, FOR KEY SHARE, LOCK IN SHARE MODE), matches keywords case-insensitively, and re-reads the raw SQL pessimistically so quoting tricks (backslash strings, $$, MySQL /*! */ and --) cannot hide a second statement.
  • Both adapters send X-Frame-Options: DENY on the UI; the SPA only links http(s) suggestion URLs and URL-encodes trace ids.

Changed

  • FastAPI access/CSRF refusals and HTTPExceptions from auth dependencies now use the {"error": {"code", "message"}} shape (unauthorized, forbidden, csrf_failed).
  • max_rows = 0 now disables the row cap (it used to delete everything); 0 or None disable any of max_rows, max_age_days and the new max_spans_per_trace.
  • ?_redline= accepts profile, 1, true, yes and on on both adapters (parsed in redline_core.sampling.profile_requested).
  • A 4xx is never an error: Django's Http404/PermissionDenied are no longer recorded as the trace's error nor kept by always_keep_errors.
  • FastAPI with enabled=False installs no middleware and no SQLAlchemy listeners.

Added

  • max_spans_per_trace (default 2000): spans beyond it are counted, not stored; counts and N+1/slow-query issues stay exact; the trace is marked truncated and the UI says so.
  • Django REDLINE["STORE"], the counterpart of FastAPI's install(store=...).
  • STORAGE_PATH / PROJECT_ROOT accept any os.PathLike.
  • SQLiteStore is fork-safe (gunicorn --preload): its writer starts lazily per process.
  • Measured overhead, storage size and writer throughput (benchmarks/).