Skip to main content

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


Download files

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

Source Distribution

fact_telemetry-0.1.0a1.tar.gz (15.8 kB view details)

Uploaded Source

Built Distribution

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

fact_telemetry-0.1.0a1-py3-none-any.whl (13.4 kB view details)

Uploaded Python 3

File details

Details for the file fact_telemetry-0.1.0a1.tar.gz.

File metadata

  • Download URL: fact_telemetry-0.1.0a1.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

Hashes for fact_telemetry-0.1.0a1.tar.gz
Algorithm Hash digest
SHA256 3c85317d9e5a1b5637d3f95f35e9e92c8b1eab1fa10b30baf33e0d4fb167de30
MD5 69b30a98586adb36bff5a2805b45daf0
BLAKE2b-256 378af812d46220cf838f03381aeb9acbba469cc68d07835bf7ffd8a4b338f311

See more details on using hashes here.

File details

Details for the file fact_telemetry-0.1.0a1-py3-none-any.whl.

File metadata

File hashes

Hashes for fact_telemetry-0.1.0a1-py3-none-any.whl
Algorithm Hash digest
SHA256 a0dc83e930f268001c9cd6e024b360a7a02dd40256696520bf1823812e1d8b31
MD5 74c00eec3e6c394474b139bf8b10d6ca
BLAKE2b-256 baa2874bd98866aec9e232a6e34a5079a236cca395af135c68373babfc747745

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