OpenInference Instrumentation for MonkAI Agent
This package provides OpenInference instrumentation for the MonkAI Agent framework. It tracks the interactions between your application and various LLM providers (OpenAI, Azure OpenAI, etc.) through the MonkAI Agent framework.
Installation
pip install openinference-instrumentation-monkai-agent
Usage
The instrumentation will automatically track calls to all MonkAI Agent LLM providers (OpenAI, Azure OpenAI, etc.) and collect telemetry data including:
- Model usage details (model name, temperature, tokens, etc.)
- Request/response content
- Provider-specific attributes
- Performance metrics
- Tool usage
Basic Usage
from openinference.instrumentation.monkai_agent import MonkaiAgentInstrumentor
# Enable instrumentation
MonkaiAgentInstrumentor().instrument()
# Your MonkAI Agent code here...
Configuration
You can configure the instrumentation with custom tracers:
from opentelemetry import trace
from openinference.instrumentation import TraceConfig
from openinference.instrumentation.monkai_agent import MonkaiAgentInstrumentor
# Configure custom tracer
tracer_provider = trace.TracerProvider()
trace.set_tracer_provider(tracer_provider)
# Configure and enable instrumentation
MonkaiAgentInstrumentor().instrument(
tracer_provider=tracer_provider,
config=TraceConfig(
# Add your config options here
)
)
Collected Telemetry
The instrumentation collects the following telemetry:
Common Attributes
- Model name
- Temperature
- Max tokens
- Top P
- Frequency penalty
- Presence penalty
- Request messages
- Response messages
- Token usage statistics
Provider-Specific Attributes
- OpenAI: Provider name
- Azure: Provider name, endpoint, API version
Spans
- One span per LLM completion request
- Nested spans for provider operations
License
MIT License - See LICENSE file for details
Metadata
Release files for openinference-instrumentation-monkai-agent 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| openinference_instrumentation_monkai_agent-0.0.1.tar.gz | 3.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| openinference_instrumentation_monkai_agent-0.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 9.6 kB
Release files / openinference_instrumentation_monkai_agent-0.0.1.tar.gz
| Download URL | openinference_instrumentation_monkai_agent-0.0.1.tar.gz |
|---|---|
| Size | 3.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d11066f07124584d8c1bda05698a928eb2c83e44afe6e2a0b272003b04c4e8be
|
|
BLAKE2b-256 checksum How to use checksums |
bcda3924ca34d65d930b1b66dade6cb7dad0bbe7a042e81490dabffaa1e2cdd0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.11.11
|
Release files / openinference_instrumentation_monkai_agent-0.0.1-py3-none-any.whl
| Download URL | openinference_instrumentation_monkai_agent-0.0.1-py3-none-any.whl |
|---|---|
| Size | 5.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1e81757935178fec23e6d07e794db71c2dd5d0cb034271ea393b69bfe1b36ead
|
|
BLAKE2b-256 checksum How to use checksums |
1982f51e940f5d5d9dd2634018ff71c015dce6e9c4048f152fadaf37f94174a1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.11.11
|