How monocle2ai/monocle works
Main Components
a) Core Instrumentation Layer
• Common instrumentation components from src/monocle_apptrace/instrumentation/common
• Metamodel system which handles different frameworks
b) Framework Integration Layer
• Supported frameworks (Langchain, LlamaIndex, Haystack, etc.)
• To the core instrumentation layer
• Framework-specific adapters and helpers
c) Export System
• Various exporters (File, AWS S3, Azure Blob)
• Base exporter and processor architecture
Relationships and Data Flow
[GenAI Application] → [Framework Integration Layer] → [Core Instrumentation] → [Export System] → [Storage Destinations]
Component Details
Core Instrumentation:
┌─ Core Instrumentation ─────┐
• Span Handler │
• Instrumentor │
• Wrapper │
• Constants & Utils │
• ┘
Metamodel System:
┌─ Metamodel ──────────────┐
• Botocore │
• Haystack │
• Langchain │
• LlamaIndex │
• ┘
Export System:
┌─ Export System ──────────┐
• Base Exporter │
• File Exporter │
• S3 Exporter │
• Azure Blob Exporter │
• Okahu Exporter │
• ┘
Implementation Details
• Use rectangles for main components
Additional Elements
Supporting elements:
• Version compatibility notes
• Supported frameworks list
• Storage backend options
• Main configuration points
This system design should effectively communicate Monocle's architecture as a GenAI application tracing framework while highlighting its extensibility and integration capabilities with various frameworks and storage solutions.