Expand description
Telemetry, metrics, and observability infrastructure.
Provides OpenTelemetry integration for tracing, metrics collection, and privacy-preserving data export.
§ReasonKit Telemetry Module
Privacy-first telemetry for the ReasonKit Adaptive Learning Loop (RALL).
§Design Principles
- Local-First: All data stored in SQLite, never sent externally by default
- Privacy-First: PII stripping, differential privacy, opt-in only
- Lightweight: Minimal overhead, async batch processing
- Auditable: Full schema versioning, data lineage
§Architecture
┌─────────────────────────────────────────────────────────────┐
│ RALL TELEMETRY SYSTEM │
├─────────────────────────────────────────────────────────────┤
│ LAYER 4: AGGREGATION │
│ Local Clustering | Pattern Detection | Model Feedback │
├─────────────────────────────────────────────────────────────┤
│ LAYER 3: PRIVACY FIREWALL │
│ PII Stripping | Differential Privacy | Redaction │
├─────────────────────────────────────────────────────────────┤
│ LAYER 2: COLLECTION │
│ Event Queue | Batch Writer | Schema Validation │
├─────────────────────────────────────────────────────────────┤
│ LAYER 1: EVENTS │
│ Query Events | Feedback Events | Session Events │
└─────────────────────────────────────────────────────────────┘Structs§
- Aggregated
Metrics - Aggregated metrics for local ML optimization
- Community
Export - Community export format (fully anonymized)
- Consent
Record - Consent record for GDPR/CCPA compliance
- Feedback
Event - Feedback event - user feedback on results
- Feedback
Summary - Feedback summary
- Privacy
Config - Privacy configuration
- Privacy
Filter - Privacy filter for sanitizing telemetry events
- Query
Cluster - Query cluster for pattern detection
- Query
Error - Query error information
- Query
Event - Query event - recorded for each user query
- Session
Event - Session event
- Telemetry
Collector - Main telemetry collector
- Telemetry
Config - Main telemetry configuration
- Telemetry
Storage - Telemetry storage backend using SQLite
- Time
Range - Time range for metrics
- Tool
Usage Event - Tool usage event
- Tool
Usage Metric - Tool usage metric
- Trace
Event - Reasoning trace event - ThinkTool execution trace
Enums§
- Error
Category - Error category classification
- Feedback
Category - Feedback category
- Feedback
Type - Feedback type
- Query
Type - Query type classification
- Telemetry
Error - Telemetry error types
- Tool
Category - Tool category
Constants§
- DEFAULT_
TELEMETRY_ DB - Default telemetry database filename
- SCHEMA_
SQL - SQLite schema for telemetry database
- TELEMETRY_
SCHEMA_ VERSION - Telemetry system version for schema migrations
Functions§
- current_
version - Get the current schema version
- get_
migration_ sql - Migration SQL for future schema updates
Type Aliases§
- Telemetry
Result - Result type for telemetry operations