Module telemetry

Module telemetry 

Source
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

  1. Local-First: All data stored in SQLite, never sent externally by default
  2. Privacy-First: PII stripping, differential privacy, opt-in only
  3. Lightweight: Minimal overhead, async batch processing
  4. 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§

AggregatedMetrics
Aggregated metrics for local ML optimization
CommunityExport
Community export format (fully anonymized)
ConsentRecord
Consent record for GDPR/CCPA compliance
FeedbackEvent
Feedback event - user feedback on results
FeedbackSummary
Feedback summary
PrivacyConfig
Privacy configuration
PrivacyFilter
Privacy filter for sanitizing telemetry events
QueryCluster
Query cluster for pattern detection
QueryError
Query error information
QueryEvent
Query event - recorded for each user query
SessionEvent
Session event
TelemetryCollector
Main telemetry collector
TelemetryConfig
Main telemetry configuration
TelemetryStorage
Telemetry storage backend using SQLite
TimeRange
Time range for metrics
ToolUsageEvent
Tool usage event
ToolUsageMetric
Tool usage metric
TraceEvent
Reasoning trace event - ThinkTool execution trace

Enums§

ErrorCategory
Error category classification
FeedbackCategory
Feedback category
FeedbackType
Feedback type
QueryType
Query type classification
TelemetryError
Telemetry error types
ToolCategory
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§

TelemetryResult
Result type for telemetry operations