A minimal, async, typed APM package for Python 3.13+
Project description
Globy APM
A minimal, typed, asynchronous APM (Application Performance Monitoring) package for Python 3.13+, designed to produce metrics with minimal performance impact. currently supports OpenPanel.
Installation
From PyPI (Coming Soon)
pip install globy-apm
From Source
pip install .
Usage
Initialization
Initialize the APM client once at the start of your application (e.g., in your main.py or startup logic).
from globy_apm import GlobyAPM, OpenPanelBackend
# Configure the backend (currently OpenPanel)
backend = OpenPanelBackend(
client_id="YOUR_OPENPANEL_CLIENT_ID",
client_secret="YOUR_OPENPANEL_CLIENT_SECRET"
)
# Initialize the global APM instance
apm = GlobyAPM.init(backend)
Tracking Events
The track method is asynchronous and non-blocking. By default, it runs in "fire-and-forget" mode using background tasks to minimize impact on your application's response time.
# Track an event (Fire-and-forget, recommended for most metrics)
await apm.track("user_signup", {"email": "user@example.com"})
# Track with await (if you need to ensure it's sent before proceeding)
await apm.track("critical_event", {"status": "failed"}, fire_and_forget=False)
Accessing the Instance
After initialization, you can retrieve the global instance anywhere in your code:
from globy_apm import GlobyAPM
async def perform_action():
apm = GlobyAPM.get()
await apm.track("action_performed")
Configuration
OpenPanel Backend
The OpenPanelBackend uses the official openpanel Python SDK.
- client_id: Your OpenPanel Project Client ID.
- client_secret: Your OpenPanel Project Client Secret.
Development & Publishing
Building the Package
-
Install Build Tools:
pip install build twine
-
Build: Run the following command from the root of the project to generate distribution archives (
.tar.gzand.whlin thedist/directory):python -m build
Publishing to PyPI
- Upload:
Use
twineto upload the built archives to PyPI. You will need a PyPI account and an API token.twine upload dist/*
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 globy_apm-0.1.0.tar.gz.
File metadata
- Download URL: globy_apm-0.1.0.tar.gz
- Upload date:
- Size: 3.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5e7c8ff728533d8145d28434a061e2a7d12ca45b4a330cc37e5453f28b3da866
|
|
| MD5 |
bf87e744d012ed6298c8e2ad2f27fb25
|
|
| BLAKE2b-256 |
b9e339a0863667260005f261d9273cec57f5f1295c32ae4cf5574e8a3a546718
|
File details
Details for the file globy_apm-0.1.0-py3-none-any.whl.
File metadata
- Download URL: globy_apm-0.1.0-py3-none-any.whl
- Upload date:
- Size: 4.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
06b80b3963edd57a2b018f0786827b3974146f9b1817bab38a59ed6bd3c4fed1
|
|
| MD5 |
89f2df74534b0f93ed51593958184b08
|
|
| BLAKE2b-256 |
97aa29e5b80536c21143007f45aebcd710d71778f3ee11413bd6ee9e70119810
|