Python SDK for tool usage logging and monitoring
Project description
Observe Python SDK
A Python SDK for tool usage logging and monitoring.
Installation
pip install observee
Usage
You can set the MCP server name either globally or per decorator:
Global Configuration
from observee import ObserveeConfig, observee_usage_logger
# Set the MCP server name globally
ObserveeConfig.set_mcp_server_name("your-mcp-server-name")
@observee_usage_logger
async def your_function():
# Your code here
pass
API Key Configuration (Enterprise Customers Only)
from observee import ObserveeConfig
# Set your enterprise API key
ObserveeConfig.set_api_key("your-enterprise-api-key")
Per-Decorator Configuration
from observee import ObserveeConfig, observee_usage_logger
@observee_usage_logger
async def your_function():
# Your code here
pass
Features
- Tool usage logging with async support
- Automatic logging of:
- Tool name
- Input parameters
- Response data
- Execution duration
- Error information (if any)
- Configurable logging endpoint (defaults to Observe API)
- Error handling and reporting
- Performance tracking
- Flexible MCP server name configuration
- Enterprise API key support for enhanced features
Logging Details
The SDK automatically logs the following information for each tool usage:
- MCP server name
- Tool name (derived from function name)
- Tool input parameters (as JSON)
- Tool response
- Execution duration in milliseconds
- Any errors that occur during execution
- API key (for enterprise customers only)
Logs are sent asynchronously to avoid impacting tool performance.
Requirements
- Python 3.8 or higher
- Dependencies:
- httpx
- pydantic
License
MIT
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
observee-0.1.2.tar.gz
(3.4 kB
view details)
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 observee-0.1.2.tar.gz.
File metadata
- Download URL: observee-0.1.2.tar.gz
- Upload date:
- Size: 3.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.12.1.2 readme-renderer/44.0 requests/2.32.3 requests-toolbelt/1.0.0 urllib3/2.4.0 tqdm/4.67.1 importlib-metadata/8.7.0 keyring/25.6.0 rfc3986/1.5.0 colorama/0.4.6 CPython/3.10.16
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
803545aa946f2136c06a19420a982ca7fe32e6b214fc0cf8a706193265e33657
|
|
| MD5 |
117ddf66ec0807361756c0666eedb711
|
|
| BLAKE2b-256 |
b6707da7871417c0dbace27004f803ff1e2d411667dc56da24d9e0e1661a069f
|
File details
Details for the file observee-0.1.2-py3-none-any.whl.
File metadata
- Download URL: observee-0.1.2-py3-none-any.whl
- Upload date:
- Size: 3.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.12.1.2 readme-renderer/44.0 requests/2.32.3 requests-toolbelt/1.0.0 urllib3/2.4.0 tqdm/4.67.1 importlib-metadata/8.7.0 keyring/25.6.0 rfc3986/1.5.0 colorama/0.4.6 CPython/3.10.16
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d846f8f57520832b081459686dee477ef2bd2b77aee42192eb89ab7eefcc7211
|
|
| MD5 |
6385287530e6cb288bb0dfaf659c9ec0
|
|
| BLAKE2b-256 |
7148613edf675894afbc1605d38ab36018e877eaab1f0f007ed388fd5f2b37a3
|