Skip to main content

Auto-instrumentation SDK for FastAPI and Flask: zero-code latency, error rates, and status codes shipped to a Reqly collector.

Project description

reqly

Open-source API observability SDK for FastAPI and Flask.
Auto-instrument your app with 2 lines of code — get latency percentiles, error rates, status distribution, top routes, and weekly AI-generated anomaly reports.

PyPI Python License: GPL v3


Install

pip install reqly

Usage

FastAPI

import reqly
from fastapi import FastAPI

app = FastAPI()
reqly.instrument(app, service_name="checkout-api")
# Every route is now tracked — latency · error rate · status codes

Flask

import reqly
from flask import Flask

app = Flask(__name__)
reqly.instrument(app, service_name="checkout-api")

instrument() auto-detects FastAPI vs Flask — no other code changes needed.

What you get

  • p50 / p95 / p99 latency per route
  • Error rates and status code distribution (2xx / 3xx / 4xx / 5xx)
  • Top routes ranked by volume and error rate
  • Live requests/min tile, time windows 1h / 6h / 24h / 7d
  • Weekly AI anomaly report — z-score detection with Groq (Llama 3.3-70b) writing the narrative

"Your /auth endpoint degrades every Monday morning (08:00–10:00), with error rate at 18% vs. a 2% baseline and p95 latency at 1850ms vs. 320ms baseline."

Live Demo

Reqly is running live against EventFlow, a Flask event management app.

Login as Administrator (admin@eventhub.com / Admin@123) → click Metrics in the nav.

Configuration

Every option can be passed as a kwarg to instrument() or set via environment variable.
Resolution order: kwarg → env var → default.

kwarg env var default
service_name REQLY_SERVICE_NAME sys.argv[0] basename
collector_url REQLY_COLLECTOR_URL http://localhost:8000
api_key REQLY_API_KEY None
sample_rate REQLY_SAMPLE_RATE 1.0
flush_interval_seconds REQLY_FLUSH_INTERVAL_SECONDS 5.0
max_batch_size REQLY_MAX_BATCH_SIZE 200
max_queue_size REQLY_MAX_QUEUE_SIZE 2000
ignore_routes REQLY_IGNORE_ROUTES (comma-separated) /health,/metrics
capture_request_body REQLY_CAPTURE_REQUEST_BODY False

Design guarantees

Fail-open — any internal SDK error is caught and logged once; instrumentation disables itself rather than raise into your app. A slow or unreachable collector never blocks request threads — all shipping happens on a background thread with strict HTTP timeouts.

Bounded cardinality — routes are captured as the framework's matched template (/users/{id}), never the raw path (/users/123). Unmatched paths collapse into a single __unmatched__ bucket.

Bounded memory — events are held in a fixed-size in-memory queue; under backpressure, oldest events are dropped and counted rather than growing unbounded.

Self-hosting

Reqly is fully self-hostable. Run the full stack (collector + TimescaleDB + dashboard) with Docker Compose:

git clone https://github.com/tanisheesh/reqly.git
cd reqly
docker compose up -d

See the repository and CONTRIBUTING.md for full setup instructions.

License

GPL-3.0-or-later — see LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

reqly-0.1.4.tar.gz (14.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

reqly-0.1.4-py3-none-any.whl (13.5 kB view details)

Uploaded Python 3

File details

Details for the file reqly-0.1.4.tar.gz.

File metadata

  • Download URL: reqly-0.1.4.tar.gz
  • Upload date:
  • Size: 14.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.14

File hashes

Hashes for reqly-0.1.4.tar.gz
Algorithm Hash digest
SHA256 aaf25c1c099ab191671c41deeb5c3649bef3e3be1b1a9fabb5d0081979ce1262
MD5 215cb5e21be2ddfea562700a649702d6
BLAKE2b-256 7ee1f7181ae77acfe8f3394a61f9c53b939c1c88fa8cda37f4c417673cbf1407

See more details on using hashes here.

File details

Details for the file reqly-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: reqly-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 13.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.14

File hashes

Hashes for reqly-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 81094dfc4dcf1479eb7f1dd948ce94358da1a17617774c0ee2722ee4d25a5374
MD5 464ffa4616eb780a3aaed0299954ecc8
BLAKE2b-256 36b05566fba247cbb85ddc3dd063b9410b3da023652c9bbe139837bc90bec5bc

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page