Skip to main content

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() function
         setup_monocle_telemetry(workflow_name="your-app-name")
      
  • (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.16

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for monocle-apptrace 0.8.16
File Size Uploaded Provenance Actions
monocle_apptrace-0.8.16.tar.gz 291.8 kB With provenance Details for monocle_apptrace-0.8.16.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for monocle-apptrace 0.8.16
File Interpreter ABI Platform Actions
monocle_apptrace-0.8.16-py3-none-any.whl Python 3 none any Details for monocle_apptrace-0.8.16-py3-none-any.whl

Total release size: 705.0 kB

Release files / monocle_apptrace-0.8.16.tar.gz

Download URL monocle_apptrace-0.8.16.tar.gz
Size 291.8 kB
Tags Source
SHA-256 checksum
How to use checksums
6a35130f12b1368e9c256ab26d391f8c56c7d2381cddc0fd3e3f3829befc656f
BLAKE2b-256 checksum
How to use checksums
79d82347b0d90284b06a6db66d345fa283eff4483aef4e5e244f71a36ff2e233
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Oct 30, 2026.

Transparency log

Release files / monocle_apptrace-0.8.16-py3-none-any.whl

Download URL monocle_apptrace-0.8.16-py3-none-any.whl
Size 413.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1f6dafb23a05508f0a0585cf6c3ef68a7b8a12df277ebc2e1c1c12efe8650a6a
BLAKE2b-256 checksum
How to use checksums
49c50b7ebfb77c9a09e786032174a7170771930fbc70421691686e6faf4a2f76
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Oct 30, 2026.

Transparency log

Security for monocle-apptrace 0.8.16

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for monocle_apptrace-0.8.16.tar.gz

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 Oct 30, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.8.16 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page