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.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

monocle_apptrace-0.8.13.tar.gz (273.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

monocle_apptrace-0.8.13-py3-none-any.whl (392.6 kB view details)

Uploaded Python 3

File details

Details for the file monocle_apptrace-0.8.13.tar.gz.

File metadata

  • Download URL: monocle_apptrace-0.8.13.tar.gz
  • Upload date:
  • Size: 273.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for monocle_apptrace-0.8.13.tar.gz
Algorithm Hash digest
SHA256 fa1ef2ef53fef90787dbc6258c822ce6c533f1a843a1ef765b73354da9b90378
MD5 b42d85f604f45d198012027ec3280db6
BLAKE2b-256 3a49fb8bcfe63a9218a4e0826257c0a24429d56965c6023c4e48002b9dfa51d2

See more details on using hashes here.

Provenance

The following attestation bundles were made for monocle_apptrace-0.8.13.tar.gz:

Publisher: release.yml on monocle2ai/monocle

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file monocle_apptrace-0.8.13-py3-none-any.whl.

File metadata

File hashes

Hashes for monocle_apptrace-0.8.13-py3-none-any.whl
Algorithm Hash digest
SHA256 33513eb59bc33cc459ccdf7c911e37345eab5388743dd3405007c3b8e4d40315
MD5 780edb79e1a11defba8007ca68822f65
BLAKE2b-256 e7b2b19a0bd361c897a17353c83ee52bda3a288f5bed54c0b5f68901580b52ea

See more details on using hashes here.

Provenance

The following attestation bundles were made for monocle_apptrace-0.8.13-py3-none-any.whl:

Publisher: release.yml on monocle2ai/monocle

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.8.13 This release

2 files

0.8.12

2 files

0.8.11

2 files

0.8.10

2 files

0.8.8

2 files

0.8.8a1

2 files

0.8.6

2 files

0.8.5

2 files

0.8.4

2 files

0.8.3

2 files

0.8.1

2 files

0.8.0

2 files

0.7.9

2 files

0.7.8

2 files

0.7.7

2 files

0.7.6

2 files

0.7.5

2 files

0.7.4

2 files

0.7.3

2 files

0.7.2

2 files

0.7.1

2 files

0.7.0

2 files

0.6.6

2 files

0.6.0

2 files

0.5.3

2 files

0.5.2

2 files

0.5.1

2 files

0.5.0

2 files

0.4.2

2 files

0.4.1

2 files

0.4.0

2 files

0.3.1

2 files

0.3.0

2 files

0.2.0

2 files

0.1.1

2 files

0.1.0

2 files

0.0.1

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page