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.
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
Logs View
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
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 supertracer-0.1.3.tar.gz.
File metadata
- Download URL: supertracer-0.1.3.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
59ac280c46b13cd3c6d3435058d021754d24f72366bc9ff0201175812a6c1fe8
|
|
| MD5 |
6879123633771ff5f26e016e5ae41848
|
|
| BLAKE2b-256 |
18141c9a7961dfa91062cd6753f2b9f7cef8881445f7fccdc69c6bb1363050ca
|
Provenance
The following attestation bundles were made for supertracer-0.1.3.tar.gz:
Publisher:
publish.yml on Tomas-Santana/supertracer
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
supertracer-0.1.3.tar.gz -
Subject digest:
59ac280c46b13cd3c6d3435058d021754d24f72366bc9ff0201175812a6c1fe8 - Sigstore transparency entry: 759649553
- Sigstore integration time:
-
Permalink:
Tomas-Santana/supertracer@84b054fb675fad19bf272714fe711887ead19f40 -
Branch / Tag:
refs/tags/v0.1.3 - Owner: https://github.com/Tomas-Santana
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@84b054fb675fad19bf272714fe711887ead19f40 -
Trigger Event:
release
-
Statement type:
File details
Details for the file supertracer-0.1.3-py3-none-any.whl.
File metadata
- Download URL: supertracer-0.1.3-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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d797d8ba29070311419bafcd76d9e5b41b3140ec2c54cca064d2511e95005b5f
|
|
| MD5 |
d29674c96e5bdce013798f3d99a69464
|
|
| BLAKE2b-256 |
3294924b81d1fcf18eda263ac1ab921250178efebdeab420722eb51c6ffb78af
|
Provenance
The following attestation bundles were made for supertracer-0.1.3-py3-none-any.whl:
Publisher:
publish.yml on Tomas-Santana/supertracer
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
supertracer-0.1.3-py3-none-any.whl -
Subject digest:
d797d8ba29070311419bafcd76d9e5b41b3140ec2c54cca064d2511e95005b5f - Sigstore transparency entry: 759649579
- Sigstore integration time:
-
Permalink:
Tomas-Santana/supertracer@84b054fb675fad19bf272714fe711887ead19f40 -
Branch / Tag:
refs/tags/v0.1.3 - Owner: https://github.com/Tomas-Santana
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@84b054fb675fad19bf272714fe711887ead19f40 -
Trigger Event:
release
-
Statement type: