Skip to main content

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

project_monitor_sdk-0.1.1.tar.gz (7.0 kB view details)

Uploaded Source

Built Distribution

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

project_monitor_sdk-0.1.1-py3-none-any.whl (7.0 kB view details)

Uploaded Python 3

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

Hashes for project_monitor_sdk-0.1.1.tar.gz
Algorithm Hash digest
SHA256 4d65a9b92983cd9f2b6dabecfebb6425aca1953e2cacba427c92e10c6e4bff66
MD5 0e2abe3261d6c23538afe39949f7d3ab
BLAKE2b-256 d4cca31550a0afd4bb5b2ff1501c4ed187bf51c12b19bb1bf25cbb077362db23

See more details on using hashes here.

File details

Details for the file project_monitor_sdk-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for project_monitor_sdk-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 638a92a3891914eddcb5df82161c7c13ac4204097b14aac37da182f724d64429
MD5 3355c737149bc8bac02b658a3b6b0c2c
BLAKE2b-256 7f36e0be52175361cb31b66f013e7598d5b3b246ed69f979a2418bb576cbaf83

See more details on using hashes here.

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