Skip to main content

A powerful and easy-to-use logging and tracing library for FastAPI applications.

Project description

SuperTracer

SuperTracer is a powerful and easy-to-use logging and tracing library for FastAPI applications. It provides a real-time dashboard to monitor requests, analyze performance, and debug issues with ease.

Dashboard Preview

Features

  • Real-time Dashboard: Monitor incoming requests and logs as they happen.
  • Comprehensive Logging: Captures request/response bodies, headers, status codes, latency, and more.
  • Multiple Storage Backends: Support for In-Memory, SQLite, and PostgreSQL.
  • Advanced Filtering: Filter logs by method, status code, latency, date, and content.
  • Metrics & Analytics: Visualize request rates, error rates, and latency distributions.
  • Secure: Built-in authentication for the dashboard and API.
  • Easy Configuration: Configure via JSON file or Python objects.

Installation

pip install supertracer

Quick Start

Integrate SuperTracer into your FastAPI application in just a few lines of code:

from fastapi import FastAPI
from supertracer import SuperTracer

app = FastAPI()

# Initialize SuperTracer (defaults to In-Memory storage)
tracer = SuperTracer(app)

@app.get("/")
def read_root():
    return {"Hello": "World"}

Now run your application and visit /supertracer/logs to see the dashboard!

Storage Backends

SuperTracer supports different storage backends. By default, it uses an in-memory connector. To use a persistent database, pass the connector instance:

SQLite

from supertracer import SuperTracer, SQLiteConnector

# ... app setup ...

connector = SQLiteConnector("requests.db")
tracer = SuperTracer(app, connector=connector)

PostgreSQL

from supertracer import SuperTracer, PostgreSQLConnector

# ... app setup ...

connector = PostgreSQLConnector(
    host="localhost",
    port=5432,
    database="supertracer_db",
    user="your_username",
    password="your_password"
    sslmode="prefer"
)
tracer = SuperTracer(app, connector=connector)

Configuration

SuperTracer is highly configurable. You can use a supertracer.config.json file in your project root or pass options programmatically.

Using supertracer.config.json

Create a file named supertracer.config.json to configure logging, metrics, auth, and more:

{
  "logger_options": {
    "level": 20,
    "format": "%(message)s"
  },
  "metrics_options": {
    "enabled": true,
    "history_limit": 1000
  },
  "capture_options": {
    "capture_request_body": true,
    "max_request_body_size": 10240,
    "capture_response_body": true
  }
}

Programmatic Configuration

You can also pass options directly:

from supertracer import SuperTracer, SupertracerOptions, LoggerOptions

options = SupertracerOptions(
    logger_options=LoggerOptions(level=10), # DEBUG
)

tracer = SuperTracer(app, options=options)

UI Overview

Dashboard

Dashboard

Logs View

Logs View

Request Details

Request Details

Documentation

For detailed documentation on all available options, connectors, and advanced usage, please refer to the docs folder.

License

MIT

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

supertracer-0.1.4.tar.gz (28.1 kB view details)

Uploaded Source

Built Distribution

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

supertracer-0.1.4-py3-none-any.whl (46.5 kB view details)

Uploaded Python 3

File details

Details for the file supertracer-0.1.4.tar.gz.

File metadata

  • Download URL: supertracer-0.1.4.tar.gz
  • Upload date:
  • Size: 28.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for supertracer-0.1.4.tar.gz
Algorithm Hash digest
SHA256 6c18e180c0ed6e798650b7d1f3cc4fdada6c3d699760a3103a6141093634f998
MD5 a2e6166f662a8098c3eb46664e38a09a
BLAKE2b-256 0fe02e2c42a05109be6b23989867f146e29b8813f4f936398b9872ac035fa4e2

See more details on using hashes here.

Provenance

The following attestation bundles were made for supertracer-0.1.4.tar.gz:

Publisher: publish.yml on Tomas-Santana/supertracer

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file supertracer-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: supertracer-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 46.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for supertracer-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 eaac74b3fa1a2c2666a81270335899dba2c84a8f4f470ccf60fa6959104cd1a3
MD5 27c6513eef13d11b01609a39c43298b6
BLAKE2b-256 95ef03a4cb7032fcf4ecbc935625937d0a1b8eaf801b4e0a2932755bc706ded5

See more details on using hashes here.

Provenance

The following attestation bundles were made for supertracer-0.1.4-py3-none-any.whl:

Publisher: publish.yml on Tomas-Santana/supertracer

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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