Rohas provides comprehensive observability through telemetry, including traces, metrics, and logs. This enables you to monitor, debug, and optimize your event-driven applications.
Telemetry in Rohas collects:
Configure telemetry in config/rohas.toml:
[telemetry] # Adapter type: rocksdb (default), prometheus, influxdb, timescaledb type = "rocksdb" # Path to telemetry storage (relative to project root or absolute) path = ".rohas/telemetry" # Retention period for traces in days (0 = keep forever) retention_days = 30 # Maximum number of traces to keep in memory cache max_cache_size = 1000 # Enable metrics collection enable_metrics = true # Enable logs collection enable_logs = true # Enable traces collection enable_traces = true
Embedded key-value database for local telemetry storage.
Features:
Configuration:
[telemetry] type = "rocksdb" path = ".rohas/telemetry" retention_days = 30
Use cases:
Export metrics to Prometheus for monitoring and alerting.
Features:
Configuration:
[telemetry] type = "prometheus" endpoint = "http://localhost:9090"
Note: Prometheus adapter is planned but not yet implemented.
Store telemetry data in InfluxDB time-series database.
Features:
Configuration:
[telemetry] type = "influxdb" url = "http://localhost:8086" database = "rohas" retention_policy = "30d"
Note: InfluxDB adapter is planned but not yet implemented.
Store telemetry in TimescaleDB (PostgreSQL extension).
Features:
Configuration:
[telemetry] type = "timescaledb" connection_string = "postgresql://user:pass@localhost/rohas"
Note: TimescaleDB adapter is planned but not yet implemented.
Distributed tracing tracks requests and events across the system.
Each trace contains:
Traces are automatically collected for:
Traces are stored and can be queried via:
Performance metrics provide insights into system behavior.
Handler Metrics:
handler.execution.count - Total executionshandler.execution.duration - Execution time (ms)handler.execution.errors - Error counthandler.execution.success - Success countEvent Metrics:
event.published.count - Events publishedevent.handled.count - Events handledevent.handled.duration - Handling time (ms)System Metrics:
system.memory.usage - Memory usagesystem.cpu.usage - CPU usagesystem.active.handlers - Active handler countMetrics include labels for filtering:
handler_name - Handler identifierhandler_type - api, event, cron, websocketlanguage - typescript, pythonstatus - success, errorStructured logging captures events and errors.
Logs are stored as structured JSON:
{ "timestamp": "2024-01-01T00:00:00Z", "level": "INFO", "message": "Handler executed", "handler": "CreateUser", "trace_id": "...", "metadata": { "execution_time_ms": 45, "status": "success" } }
The Workbench UI provides:
Access via: http://localhost:3000/workbench
Configure data retention to manage storage:
[telemetry] retention_days = 30 # Keep data for 30 days
0 = Keep forever> 0 = Delete after N days[telemetry] max_cache_size = 1000 # Keep 1000 traces in memory
Larger cache improves query performance but uses more memory.
Use the Workbench UI to:
Telemetry endpoints (when enabled):
GET /telemetry/traces - List tracesGET /telemetry/traces/:id - Get trace detailsGET /telemetry/metrics - Get metricsGET /telemetry/logs - Query logsIssue: Telemetry storage growing too large
Solutions:
retention_daysIssue: Telemetry affecting application performance
Solutions:
max_cache_sizeIssue: Traces not appearing
Solutions: