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.1.tar.gz (14.1 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.1-py3-none-any.whl (13.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: reqly-0.1.1.tar.gz
  • Upload date:
  • Size: 14.1 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.1.tar.gz
Algorithm Hash digest
SHA256 72cf1343e8f47bca3247f5f4e827c8d6b42da2c34cd0c657a517e5c23097dafa
MD5 9fce9a41171808c7da13f69441362e09
BLAKE2b-256 d39e61ff650ee6bcbdd83d8c9c4cb1d5b1dc3f37c120242865311ce2ea440711

See more details on using hashes here.

File details

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

File metadata

  • Download URL: reqly-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 13.1 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 77322435b1413519fa21f53a89a8c649382d78311f63bf7d1191fab26709a0e8
MD5 5e47ca8621d7784ae3cba043544fd668
BLAKE2b-256 f41dc859600b1a0f2ecfb8ddf5699d8df8160201879249dcd700a1dfaaeb78b6

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