Practical overview
When it fits
Use Monocle when you need code-level tracing for a GenAI application and want to capture telemetry without implementing a custom instrumentation layer. Its quickstart is especially relevant when you can run a Python application through Monocle or need to add instrumentation because you do not control its runtime.
Who it is for
- Application developers who want to trace GenAI code across environments.
- Platform engineers instrumenting production applications through wrapping rather than asking application developers to recode GenAI components.
- GenAI component providers adding observability features to their products.
- Enterprises consuming GenAI application traces in an existing open-source observability stack.
Documented uses
- Instrument a GenAI application to capture execution traces.
- Trace activity across application code, model inference, and data retrieval.
- Save captured traces locally as JSON or export telemetry to local or cloud storage.
- Provide a consistent tracing format across GenAI component providers.
Requirements & limits
The project documentation describes Monocle as fully open source and community driven.
- The quickstart documents TypeScript and Python instrumentation.
- Python tracing has separate paths depending on whether you control how the application is run.
- Trace output is written to a local JSON file by default; the project also describes export to local and cloud storage.
- Monocle uses an OpenTelemetry-compatible format and supplies its own implementation and package.
Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.
Capture traces from a Python application
Use Monocle to generate traces from a Python application and locate the default JSON output.
Before you start
- A Python GenAI application.
- For the no-instrumentation route, control over how the application is run; otherwise, the documented instrumentation route is for an application whose runtime you do not control.
Steps
Install the Monocle package with the command below.
pip install monocle_apptraceIf you control the application launch, run it with the command below.
python -m monocle_apptrace your-app-name.pyIf you do not control the runtime, import
setup_monocle_telemetryfrommonocle_apptrace.instrumentation.common.instrumentorand call it in the application'smain()function with a workflow name.Look for the generated
monocle_trace___.jsonfile in the directory where the application runs.
Expected outcome
Monocle writes traces to a JSON file by default in the application's execution directory.
Guide limitations
- The quickstart presents the launch-through-Monocle and in-code instrumentation paths as alternatives based on runtime control.
- The documented default output is a local JSON file; this guide does not cover configuring another export destination.
Compare options for Model inference and serving
These projects document a common task and share a project role. This is a source-based comparison, not an execution benchmark or a guarantee of interchangeability.
| Project | Documented purpose | Platform | Access and requirements |
|---|---|---|---|
| Project Monocle | Instrument a GenAI application to capture execution traces. | The project documentation describes Monocle as fully open source and community driven. | |
| FMBench | Compare inference latency and transactions per minute across model-serving configurations. | CLI, Cloud | FMBench is distributed as a Python package and used from the command line. The project is published under the MIT-0 license. |
Sources & review
Source record details
- Source availability
- Active
- Sources checked
- 12 October 2026
- Original website title
- Monocle | Project Monocle · Official homepage title · retained in its source language

