A low-intrusion tracing framework for GenAI application code, enabling end-to-end production monitoring and debugging.
Monocle is a tracing framework purpose-built for GenAI applications, designed to solve observability challenges around LLM invocations, Agent decision-making, and vector retrieval in production environments. The project adopts a metamodel-driven approach, utilizing a community-curated JSON Schema to provide consistent tracing semantics for various AI components while maintaining full OpenTelemetry compatibility.
Core Features#
- Low-Intrusion Code Instrumentation: Application developers can enable end-to-end tracing with just two lines of code, while platform engineers can leverage codeless Wrapping injection.
- Metamodel-Driven: Defines GenAI semantics (LLM calls, vector retrieval, Agent execution, etc.) via
span_format.json, providing consistent tracing standards with community extensibility. - OpenTelemetry Compatible: Generated Span data is fully OTEL-compliant, directly integrable with backends like Jaeger and Grafana Tempo.
- Multi-Backend Export: Built-in stdout, file, and memory exporters, plus support for Azure Blob Storage, AWS S3, Google Cloud Storage, Okahu Cloud, and OTEL-compatible Collectors.
- Behavioral Testing Tool: Supports defining inputs, expected outputs, and expected Agent/Tool calls to auto-generate Traces and verify actual behavior.
- MCP Server: Integrates with VS Code / GitHub Copilot and other IDEs, providing curated Prompts and tools for Trace analysis.
Framework Integration Matrix#
- Agentic Frameworks: LangGraph, LlamaIndex, Google ADK, OpenAI Agent SDK, AWS Strands, CrewAI, Microsoft Agent Framework, AWS Bedrock Agentcore
- Protocols & Communication: FastMCP, MCP Client, A2A Client
- LLM Orchestration: LangChain, LlamaIndex, Haystack
- Web & Serverless: Flask, FastAPI, AIOHTTP, Azure Function, AWS Lambda, Vercel (TS), Microsoft Teams AI SDK
LLM Provider Coverage#
OpenAI, Anthropic, AWS Bedrock, Google Vertex, Azure OpenAI, Hugging Face, Deepseek, Mistral, and other major inference services.
Quick Start#
pip install monocle_apptrace
from monocle_apptrace.instrumentor import setup_monocle_telemetry
setup_monocle_telemetry(workflow_name="your-app-name")
Project Governance#
Donated by Okahu, Inc., currently a Sandbox-stage project under the Linux Foundation AI & Data (LF AI & Data). The primary repository is Python-based (v0.7.8, 37 releases), with an independent TypeScript implementation also available. Note: The official website monocle2ai.org currently has SSL certificate issues and is inaccessible.