An asynchronous telemetry framework for FastAPI with pluggable storage backends.
Project description
FACT
FACT (FastAPI Advanced Collection Telemetry) is a lightweight, asynchronous telemetry framework for FastAPI applications.
FACT captures request telemetry through middleware, validates telemetry records, buffers them in an asynchronous in-memory queue, and persists them to configurable storage backends using batched writes. The framework is designed to minimize request overhead while providing reliable telemetry collection through retry mechanisms, dead-letter queue (DLQ) support, and runtime metrics.
FACT currently supports PostgreSQL and ClickHouse storage backends and provides a configurable architecture suitable for high-throughput, multi-tenant applications.
Status: Alpha Development
Features
- Middleware-based automatic telemetry collection
- Asynchronous in-memory queue
- Configurable batch processing
- PostgreSQL storage backend
- ClickHouse storage backend
- Multi-tenant request support
- Dynamic metadata support
- Payload validation
- Exponential backoff retry mechanism
- Local file-based Dead Letter Queue (DLQ)
- Runtime telemetry metrics
- Centralized configuration using
FactConfig - Environment variable support
- Automated test suite
- Benchmark and soak testing utilities
Architecture
Incoming Request
│
▼
ClickHouseTelemetryMiddleware
│
▼
Payload Validation
│
▼
Async In-Memory Queue
│
▼
Batch Collection
│
▼
Retry with Backoff
│
┌─────────┴─────────┐
│ │
▼ ▼
Storage Backend Dead Letter Queue
│
▼
PostgreSQL / ClickHouse
FACT separates request processing from persistence by using an asynchronous producer-consumer architecture. Incoming requests enqueue telemetry records immediately, while a background worker batches and persists records independently. This minimizes request latency and provides resilience during temporary storage failures.
Documentation
Detailed documentation is available in the docs/ directory.
- Installation
- Quick Start
- Architecture
- Configuration
- Storage Backends
- Middleware
- Benchmarking
- Roadmap
Project Status
FACT is currently in Alpha Development.
Implemented capabilities include:
- Middleware-based telemetry ingestion
- Batch processing engine
- PostgreSQL backend
- ClickHouse backend
- Retry with exponential backoff
- Dead Letter Queue (DLQ)
- Payload validation
- Runtime metrics
- Benchmarking utilities
- Automated tests
License
This project is licensed under the Apache License 2.0.
See the LICENSE file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file fact_telemetry-0.1.0a2.tar.gz.
File metadata
- Download URL: fact_telemetry-0.1.0a2.tar.gz
- Upload date:
- Size: 15.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
50a368f048a9cb0c041903db4611ff0436c2795996cae270926322e83ca00043
|
|
| MD5 |
64fcca68594c4f761d84d2bd3ec4c173
|
|
| BLAKE2b-256 |
aa52852e12733e4f9edd70b7033ef2dd41fad72d67ec00753682ff50636595df
|
File details
Details for the file fact_telemetry-0.1.0a2-py3-none-any.whl.
File metadata
- Download URL: fact_telemetry-0.1.0a2-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.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
91df2e785b53bf4c91591dba3a10d53eef9146b4e4ba19750e38b40c796f0e74
|
|
| MD5 |
dfe6b77f864bc13cf8c49abac5e8baa1
|
|
| BLAKE2b-256 |
d607a4427870f374669c72c8db2fe29c0eb36200ac2c5351c28292c653997891
|