Official SDK for the Project Monitor AI Observability Platform
Project description
Project Monitor SDK
Official Python SDK for the Project Monitor AI Observability Platform.
Install
pip install project-monitor-sdk
Or in editable / development mode from this repo:
pip install -e "e:\Project Monitor\sdk"
Quick start
from monitor_sdk import Monitor, MonitorASGIMiddleware
monitor = Monitor(
api_key="pm_your_api_key",
base_url="http://localhost:8000",
service_name="my-service",
min_level="WARN", # only WARN and above are sent
)
# Manual logging
monitor.warn("disk usage above 90%", operation="disk_check", metadata={"usage_pct": 91})
monitor.error("payment failed", operation="checkout", error_type="TimeoutError")
# Capture exceptions automatically
try:
risky_operation()
except Exception as exc:
monitor.capture_exception(exc, operation="risky_operation")
# Trace a block
with monitor.trace("checkout_flow"):
process_order()
# ASGI middleware (FastAPI / Starlette) – auto-logs every request
from fastapi import FastAPI
app = FastAPI()
app.add_middleware(MonitorASGIMiddleware, monitor=monitor)
Configuration
| Parameter | Default | Description |
|---|---|---|
api_key |
required | Project Monitor API key |
base_url |
required | Backend URL, e.g. http://localhost:8000 |
service_name |
None |
Name shown in the dashboard |
min_level |
"WARN" |
Drop logs below this level (DEBUG / INFO / WARN / ERROR / CRITICAL) |
batch_size |
50 |
Flush when buffer reaches this many events |
flush_interval |
2.0 |
Seconds between automatic flushes |
max_retries |
3 |
HTTP retries per batch |
Log levels
DEBUG < INFO < WARN < ERROR < CRITICAL
Only events at or above min_level are sent to the backend.
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 project_monitor_sdk-0.1.1.tar.gz.
File metadata
- Download URL: project_monitor_sdk-0.1.1.tar.gz
- Upload date:
- Size: 7.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4d65a9b92983cd9f2b6dabecfebb6425aca1953e2cacba427c92e10c6e4bff66
|
|
| MD5 |
0e2abe3261d6c23538afe39949f7d3ab
|
|
| BLAKE2b-256 |
d4cca31550a0afd4bb5b2ff1501c4ed187bf51c12b19bb1bf25cbb077362db23
|
File details
Details for the file project_monitor_sdk-0.1.1-py3-none-any.whl.
File metadata
- Download URL: project_monitor_sdk-0.1.1-py3-none-any.whl
- Upload date:
- Size: 7.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
638a92a3891914eddcb5df82161c7c13ac4204097b14aac37da182f724d64429
|
|
| MD5 |
3355c737149bc8bac02b658a3b6b0c2c
|
|
| BLAKE2b-256 |
7f36e0be52175361cb31b66f013e7598d5b3b246ed69f979a2418bb576cbaf83
|