Skip to main content

package with monocle genAI tracing

Project description

Monocle for tracing GenAI app code

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.

Why Monocle

Monocle is built for:

  • app developers to trace their app code in any environment without lots of custom code decoration
  • platform engineers to instrument apps in prod through wrapping instead of asking app devs to recode
  • GenAI component providers to add observability features to their products
  • enterprises to consume traces from GenAI apps in their existing open-source observability stack

Benefits:

  • Monocle provides an implementation + package, not just a spec
    • No expertise in OpenTelemetry spec required
    • No bespoke implementation of that spec required
    • No last-mile GenAI domain specific code required to instrument your app
  • Monocle provides consistency
    • Connect traces across app code executions, model inference or data retrievals
    • No cleansing of telemetry data across GenAI component providers required
    • Works the same in personal lab dev or org cloud prod environments
    • Send traces to location that fits your scale, budget and observability stack
  • Monocle is fully open source and community driven
    • No vendor lock-in
    • Implementation is transparent
    • You can freely use or customize it to fit your needs

What Monocle provides

  • Easy to use code instrumentation
  • OpenTelemetry compatible format for spans.
  • Community-curated and extensible metamodel for consisent tracing of GenAI components.
  • Export to local and cloud storage

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.

Use Monocle MCP

First install monocle-apptrace: pip install monocle-apptrace==0.5.0a1

Open bash and run the following command to run the monocle mcp server with stdio: test_apptrace

If you are using VS Code you can add following entry to your .vscode/mcp.json

"monocle-mcp-server": {
      "command": "test_apptrace",
      "args": [
         
      ],
      "env": {},
      "type": "stdio"
   }

Roadmap

Goal of Monocle is to support tracing for apps written in any language with any LLM orchestration or agentic framework and built using models, vectors, agents or other components served up by any cloud or model inference provider.

Current version supports:

  • Language: (🟢) Python , (🔜) Typescript
  • LLM-frameworks: (🟢) Langchain, (🟢) Llamaindex, (🟢) Haystack, (🔜) Flask
  • LLM inference providers: (🟢) OpenAI, (🟢) Azure OpenAI, (🟢) Nvidia Triton, (🔜) AWS Bedrock, (🔜) Google Vertex, (🔜) Azure ML, (🔜) Hugging Face
  • Vector stores: (🟢) FAISS, (🔜) OpenSearch, (🔜) Milvus
  • Exporter: (🟢) stdout, (🟢) file, (🔜) Azure Blob Storage, (🔜) AWS S3, (🔜) Google Cloud Storage

Get involved

Provide feedback

  • Submit issues and enhancements requests via Github issues

Contribute

  • Monocle is community based open source project. We welcome your contributions. Please refer to the CONTRIBUTING and CODE_OF_CONDUCT for guidelines. The contributor's guide provides technical details of the project.

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

test_apptrace-0.5.5.tar.gz (91.8 kB view details)

Uploaded Source

Built Distribution

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

test_apptrace-0.5.5-py3-none-any.whl (156.8 kB view details)

Uploaded Python 3

File details

Details for the file test_apptrace-0.5.5.tar.gz.

File metadata

  • Download URL: test_apptrace-0.5.5.tar.gz
  • Upload date:
  • Size: 91.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.7

File hashes

Hashes for test_apptrace-0.5.5.tar.gz
Algorithm Hash digest
SHA256 e60c2f20fc42a6d7568c14a45fb16451c10c18c5963c7340741783767290f203
MD5 5a40e457a752aa2d6f1b1c0c6c883c07
BLAKE2b-256 47049974fb9a1d2d9ef1d5abad59b730be166ba358298b520321c66c83b07fde

See more details on using hashes here.

File details

Details for the file test_apptrace-0.5.5-py3-none-any.whl.

File metadata

  • Download URL: test_apptrace-0.5.5-py3-none-any.whl
  • Upload date:
  • Size: 156.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.7

File hashes

Hashes for test_apptrace-0.5.5-py3-none-any.whl
Algorithm Hash digest
SHA256 8ee78ee7540eb537796b91c34518110e2333ad62b9b20002f6d9556ff6e033ac
MD5 af3c9eca848ebbf5dad8df6b794fae59
BLAKE2b-256 f3c1a2abf6fea01f5d43b5e25db80870b0dc7a0124437372394effdb07c39a42

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