Skip to main content

package with monocle genAI tracing

Project description

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.

Project details


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.6.tar.gz (226.0 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.6-py3-none-any.whl (338.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: monocle_apptrace-0.8.6.tar.gz
  • Upload date:
  • Size: 226.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.14

File hashes

Hashes for monocle_apptrace-0.8.6.tar.gz
Algorithm Hash digest
SHA256 f8ab1adf1bbf8de832aa7fb2af3684a8869a7062161e277c6b6e64793fae393e
MD5 2087b42ae9649a12ec6f9acee58c9436
BLAKE2b-256 077b11a26144a643f7055b40f063ebb1162f63d685958355f7340ab1e087fec0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for monocle_apptrace-0.8.6-py3-none-any.whl
Algorithm Hash digest
SHA256 ed361bbe887d18405dec98a22df52d51af8b7d99747672d649059c0e2f247915
MD5 46598eeae105ea1055dc4967d1cd2e6f
BLAKE2b-256 2afa7ef4a0935ed295cde16bedd376b68b125b696bf4c894453ee152f629b939

See more details on using hashes here.

Supported by

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