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.3.tar.gz (14.3 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.3-py3-none-any.whl (13.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: reqly-0.1.3.tar.gz
  • Upload date:
  • Size: 14.3 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.3.tar.gz
Algorithm Hash digest
SHA256 c370186d987c7a4609ba674e7ef908b36fe3024b88990979bd597a01fabfa0be
MD5 5ed5e7aecf07d32d4e5084ba3c8a82bd
BLAKE2b-256 3f47b36230216cbce3edc11bef2bc2cdb173044a7e8eb4076d8de32e93eea00b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: reqly-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 13.4 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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 9a61d827808c51fbc6bd65283dd202721d8dfad4abf8a9080a36440881aee003
MD5 3844db382a308f0569be6a916ed2e6fe
BLAKE2b-256 28cc7d0a95db59240f9652be8bb8d61ed4edb15d6b029d9e9155d05125b563ba

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