Skip to main content

🔍 AIMonitor

A lightweight, modular observability toolkit for MCP (Multi-Channel Processing) workflows

Python 3.10+ License Tests

AIMonitor tracks tool execution, exports monitoring events, and supports OpenTelemetry integration alongside file, SQLite, and Prometheus backends.

✨ Features

  • 🎯 Tool Monitoring — Automatic event capture with @monitor_tool decorator
  • 📤 Multiple Exporters — File, SQLite, Prometheus, Redis, Kafka, Webhook, OpenTelemetry
  • 🔐 Sensitive Data Redaction — Automatically masks API keys and secrets
  • 🧠 Internal Telemetry — Optional SDK observability via OpenTelemetry
  • ⚡ Async-first — Built for async workflows
  • 🛠️ Extensible — Simple interface for custom exporters

🚀 Quick start

Install

pip install aimonitor

With optional dependencies:

pip install "aimonitor[opentelemetry,sqlite,metrics,kafka]"

Monitor a tool

from core.decorators import monitor_tool

@monitor_tool
async def fetch_data(user_id: str):
    return {"data": "example"}

Export events

from exporters.file import FileExporter
from core.registry import registry

exporter = FileExporter(base_uri="./logs")
await exporter.connect()
registry.register(exporter)

# Now all monitored tool calls are exported to ./logs

📚 Documentation

🔌 Available Exporters

Exporter Purpose Status
FileExporter JSONL file output with rotation ✅ Stable
SQLiteExporter Local database storage ✅ Stable
PrometheusExporter Prometheus metrics endpoint ✅ Stable
OpenTelemetryExporter OTel span export ✅ Stable
WebhookExporter HTTP endpoint POST ✅ Stable
RedisExporter Redis pub/sub ⚠️ Beta
KafkaExporter Kafka topic producer ⚠️ Beta

🔧 Configuration

Environment variables

# Core settings
AIMONITOR_ENABLED=true
AIMONITOR_INNER_TELEMETRY=false

# Export targets
AIMONITOR_PROMETHEUS_URL=http://localhost:9000
AIMONITOR_SQLITE_URI=./aimonitor.db

# OpenTelemetry MCP exporter
AIMONITOR_OTEL_MCP_EXPORTER_ENABLED=true
AIMONITOR_OTEL_MCP_SERVICE_NAME=my-service

Or with YAML

enabled: true
inner_telemetry: false
prometheus_url: "http://localhost:9000"
otel_mcp_exporter_enabled: true
otel_mcp_service_name: "my-mcp-service"

🧪 Testing

Run the test suite:

# Unit tests
python -m pytest tests/unit -q

# All tests
python -m pytest tests/ -v

Tests run automatically on every PR to main.

📦 Deployment

Publish to PyPI

# Update version in pyproject.toml
python -m build
python -m twine upload dist/*

Docker

AIMonitor works in containerized environments. Set environment variables and mount config files as needed.

🤝 Contributing

Contributions are welcome! Please see CONTRIBUTING.md.

  1. Fork the repo
  2. Create a feature branch
  3. Add tests for new features
  4. Open a PR to main

📄 License

MIT License — see LICENSE for details.

🎯 Roadmap

  • Enhanced A2A (Agent-to-Agent) support
  • Skills framework integration
  • Web dashboard for event visualization
  • Advanced filtering and querying
  • Multi-backend batch export

Questions? Open an issue or check the docs.

Metadata

Release files for ai-monitor-sdk 0.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ai-monitor-sdk 0.0.1
File Size Uploaded Provenance Actions
ai_monitor_sdk-0.0.1.tar.gz 18.4 kB With provenance Details for ai_monitor_sdk-0.0.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ai-monitor-sdk 0.0.1
File Interpreter ABI Platform Actions
ai_monitor_sdk-0.0.1-py3-none-any.whl Python 3 none any Details for ai_monitor_sdk-0.0.1-py3-none-any.whl

Total release size: 42.9 kB

Release files / ai_monitor_sdk-0.0.1.tar.gz

Download URL ai_monitor_sdk-0.0.1.tar.gz
Size 18.4 kB
Tags Source
SHA-256 checksum
How to use checksums
80dcd79ed32be39bcf85d1f7d7e47a633cf7752db0042c7bb91a0a7230fa6e1d
BLAKE2b-256 checksum
How to use checksums
e0d070c7ee0f0cc8e99807575f5c51faef5188ce15a1df6178021e3aad05e0a0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 12, 2026.

Transparency log

Release files / ai_monitor_sdk-0.0.1-py3-none-any.whl

Download URL ai_monitor_sdk-0.0.1-py3-none-any.whl
Size 24.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
181e4fe15b6d8168492762cd0f4457aa1d4d92c85c62fda3d87a9bcb6fd88549
BLAKE2b-256 checksum
How to use checksums
24562b3d11b866ca46e748c29ba4497815fff4da605b300b38006fe78d05ab1c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 12, 2026.

Transparency log

Security for ai-monitor-sdk 0.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for ai_monitor_sdk-0.0.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 12, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.1 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page