Monocle Apptrace
Monocle helps developers and platform engineers building or managing GenAI apps monitor these in prod by making it easy to instrument their code to capture traces that are compliant with open-source cloud-native observability ecosystem.
Monocle is a community-driven OSS framework for tracing GenAI app code governed as a Linux Foundation AI & Data project.
Use Monocle
- Get the Monocle package
pip install monocle_apptrace
- Instrument your app code
- Import the Monocle package
from monocle_apptrace.instrumentor import setup_monocle_telemetry - Setup instrumentation in your
main()functionsetup_monocle_telemetry(workflow_name="your-app-name")
- Import the Monocle package
- (Optionally) Modify config to alter where traces are sent
See Monocle user guide for more details.
Claude Code Instrumentation
# 1. Install uv (if not already installed)
curl -LsSf https://astral.sh/uv/install.sh | sh
# 2. Install package
uv tool install monocle_apptrace
# 3. Register hooks — prompts for Okahu API key (leave blank for local-only)
monocle-apptrace claude-setup
Start a new Claude Code session — traces flow automatically.
See Hook Setup Guide for complete instructions.
Codex CLI Instrumentation
# 1. Install uv (if not already installed)
curl -LsSf https://astral.sh/uv/install.sh | sh
# 2. Install package
uv tool install monocle_apptrace
# 3. Register hooks — prompts for Okahu API key (leave blank for local-only)
monocle-apptrace codex-setup
Start a new Codex session — traces flow automatically.
See Hook Setup Guide for complete instructions.
GitHub Copilot Instrumentation
# 1. Install uv (if not already installed)
curl -LsSf https://astral.sh/uv/install.sh | sh
# 2. Install package
uv tool install monocle_apptrace
# 3. Register hooks — prompts for Okahu API key (leave blank for local-only)
monocle-apptrace copilot-setup
After setup, reload your environment for the config to take effect — run source ~/.zshrc (or your shell's equivalent) in the terminal, or Developer: Reload Window in VS Code.
Captures traces from both Copilot CLI and VS Code Copilot Chat. Start a session — traces flow automatically.
Token counts are collected via Copilot's built-in OpenTelemetry file exporter, which copilot-setup enables automatically. Trace data is written to ~/.monocle/.copilot_otel/copilot.jsonl and attached to the emitted OTel spans at the end of each turn.
See Hook Setup Guide for complete instructions.
Metadata
Release files for monocle-apptrace 0.8.15
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| monocle_apptrace-0.8.15.tar.gz | 282.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| monocle_apptrace-0.8.15-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 685.2 kB
Release files / monocle_apptrace-0.8.15.tar.gz
| Download URL | monocle_apptrace-0.8.15.tar.gz |
|---|---|
| Size | 282.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a6c7bca8bcc0607affd8098af5ef662f650396ed0fc49b06bcd0869e88abb78e
|
|
BLAKE2b-256 checksum How to use checksums |
fff111aba7ecb0ea9448af7f3d61ea2f3df31f716cbe2dc3b975d1d34122070d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 11, 2026.
Transparency logRelease files / monocle_apptrace-0.8.15-py3-none-any.whl
| Download URL | monocle_apptrace-0.8.15-py3-none-any.whl |
|---|---|
| Size | 402.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5726690ba8a64f62b8d1ab3fccc2ceb57f60c472ad2173f8e3ea756c9af60a22
|
|
BLAKE2b-256 checksum How to use checksums |
41402523a952de888a96d5395ca9722ab37846d1e7a93d6aa92d479c09612302
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 11, 2026.
Transparency log