Practical overview
When it fits
Use Monocle when a Python GenAI workflow needs operation-level traces for debugging or when tests should examine execution traces rather than only comparing inputs and outputs.
Who it is for
- Python developers building generative AI applications or agents.
- Platform and infrastructure engineers connecting GenAI telemetry to OpenTelemetry systems.
- Teams adding trace-based checks for agent and tool behavior to CI workflows.
Documented uses
- Inspect connected traces of model calls, agent runs, tool invocations and retrieval activity.
- Export GenAI-specific telemetry as local JSON or route OTLP-compatible traces to an existing observability backend.
- Create pytest-based checks that assert on trace events and error states.
Requirements & limits
The repository describes Monocle as open source and displays an Apache-2.0 license.
- The repository identifies the implementation as Python; the documented setup installs
monocle_apptrace. - Named instrumentation integrations include LangChain, LlamaIndex, Haystack and Google ADK; support for a specific application should be checked against its framework and provider.
- Default trace export is JSON under a local
./monocledirectory; the project also describes OTLP-compatible traces and other export options. - Trace-based tests are provided separately in
monocle-test-toolsand are built on pytest. - The project describes OpenTelemetry integration, but the evidence does not demonstrate configuration with a particular backend.
Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.
Install and initialize Monocle telemetry
Add Monocle telemetry initialization to a Python GenAI application.
Before you start
- A Python GenAI application using a framework supported by Monocle.
- Python package installation access.
Steps
Install the package with the command below.
pip install monocle_apptraceImport
setup_monocle_telemetryfrommonocle_apptrace.Call
setup_monocle_telemetry(workflow_name="your_workflow_name")in the application.
Expected outcome
Monocle configures OpenTelemetry and its metamodel; supported frameworks can be automatically instrumented. The repository says the default export is JSON trace files under `./monocle`.
Guide limitations
- Instrumentation adapters are documented for supported frameworks; compatibility with a specific application is not demonstrated.
- This guide covers installation and initialization, not running or validating an application.
Sources & review
Source record details
- Source availability
- Active
- Sources checked
- 14 October 2026
- Original website title
- monocle2ai/monocle · Official homepage title · retained in its source language

