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.0.tar.gz (6.8 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.0-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

Details for the file project_monitor_sdk-0.1.0.tar.gz.

File metadata

  • Download URL: project_monitor_sdk-0.1.0.tar.gz
  • Upload date:
  • Size: 6.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for project_monitor_sdk-0.1.0.tar.gz
Algorithm Hash digest
SHA256 c38a71ecfbc410cef0aa6905e453ae147cc74e6404994700556ff1c2aa2694e3
MD5 4c784cec0171b5c8e0e9c817fa047fba
BLAKE2b-256 035a8bce9f0d6ba25b117cecdee003e338890e3607aa64875851c6f829568b15

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for project_monitor_sdk-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7e5f740bb65fe12b73726293224f778c50eb8f8e77d1eb762e4f9fec623aae6e
MD5 121b051022dd282c87cf1bc1c284501e
BLAKE2b-256 867bb1a161192beb0d4d5cba74af85b85cac0809560968a4e7fc95a1fd655036

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