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.6.tar.gz
(3.8 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.6.tar.gz.
File metadata
- Download URL: observee-0.1.6.tar.gz
- Upload date:
- Size: 3.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5de69c981fb630845b7002cebed0d8c1c6ff236bdb6f5acb6b6bfe4fefb6bde1
|
|
| MD5 |
85e5d6e82645c03d8637e2a31e9269c8
|
|
| BLAKE2b-256 |
30c09ff0323069d71baa00376513f15842769064d3b96c1e0f7b3322aba47901
|
File details
Details for the file observee-0.1.6-py3-none-any.whl.
File metadata
- Download URL: observee-0.1.6-py3-none-any.whl
- Upload date:
- Size: 4.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
902ef3e409fb84f425ea2741c7e38d398a36d830c766235bbc9a72c03ff7db62
|
|
| MD5 |
42d115037d1b05ca95637a8010e84f9e
|
|
| BLAKE2b-256 |
9fdd91450e60cef835a2dedaa8b93f5e54f5b00282d28abd2f59435debfaceb5
|