Apollo Tracker
Apollo Tracker is a lightweight Flask middleware for tracking and reporting errors to Apollo, an internal error tracking system similar to Sentry.
Features
- 🛠 Automatic Error Tracking: Captures and reports all unhandled exceptions.
- 🚀 Flask Integration: Works seamlessly with Flask applications.
- 📡 Send Errors to Apollo: Forwards error logs to an Apollo backend.
- 🔍 Includes Request Metadata: Logs IP address, user agent, endpoint, and method.
- 📦 Simple Installation: Just
pip install apollo-tracker.
Installation
You can install apollo-tracker using pip:
pip install apollo-tracker
Usage
1. Setup ApolloTracker in Your Flask App
To start tracking errors in your Flask app, follow these steps:
-
Import the ApolloTracker class:
from apollo_tracker.tracker import ApolloTracker
-
Initialize the tracker with your service name:
tracker = ApolloTracker(service_name="projet_uid")
-
Register the error handler:
tracker.register_error_handler(app)
2. Example Flask App Setup
from flask import Flask
from apollo_tracker.tracker import ApolloTracker # import the tracker class
app = Flask(__name__)
# Initialize ApolloTracker with your service name
tracker = ApolloTracker(service_name="my_project_id")
# Register the error handler to track errors globally
tracker.register_error_handler(app)
@app.route('/')
def home():
# Simulate an error
1 / 0 # This will raise a ZeroDivisionError
if __name__ == "__main__":
app.run(debug=True)
3. Error Handling
- The
ApolloTrackerclass automatically captures unhandled exceptions in your Flask app. - When an error occurs, it sends detailed information (like the error type, message, stack trace, request path, and user agent) to the Apollo server.
Metadata
Release files for apollo-tracker 0.1.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| apollo_tracker-0.1.4.tar.gz | 2.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| apollo_tracker-0.1.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 6.1 kB
Release files / apollo_tracker-0.1.4.tar.gz
| Download URL | apollo_tracker-0.1.4.tar.gz |
|---|---|
| Size | 2.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
64e60a14ca91bf634250eff5a375ef2dca15e1d708141c7181b9a100e212cd40
|
|
BLAKE2b-256 checksum How to use checksums |
c66ee03bf785abb87505c6c2b6d3532cd7a1c8f38fcc58088ff0578dc5c713ab
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.3
|
Release files / apollo_tracker-0.1.4-py3-none-any.whl
| Download URL | apollo_tracker-0.1.4-py3-none-any.whl |
|---|---|
| Size | 3.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ff101037b35f217f3e5f469c688d09eaeebe991d1009529a1dc01f66f8cecd6e
|
|
BLAKE2b-256 checksum How to use checksums |
2c2da1c6dc9b5db65636e8dd2b9e09bcee9cf343bb8e8eca0edfe98511c466a8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.3
|