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.2.tar.gz (14.2 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.2-py3-none-any.whl (13.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: reqly-0.1.2.tar.gz
  • Upload date:
  • Size: 14.2 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.2.tar.gz
Algorithm Hash digest
SHA256 4fc215dc7f19bd1590838161d4db2e0635f2c5668f2d2766ab6f85f9d18fa164
MD5 a92a919493bc909fad7711f2197bf21a
BLAKE2b-256 bdb3178003eb778404e7a8f3ee75e857879b9dc5b541a5f3743589894c534ce4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: reqly-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 13.2 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 598b6c325f8206379240a642f572c9dbed1e7f6381c16e5b1e140538362026df
MD5 510f74390c1246e25d344ea601a72b1f
BLAKE2b-256 0e2c18c895b867c8cd323482041f65aceec68bba9a3ee3ce53242382fe4abe2d

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