How stivio00/otel-viewer works
otel-viewer combines an OTLP/gRPC collector, embedded DuckDB, HTTP REST API, and web UI, with an optional Tauri desktop shell. Exporters send traces, metrics, and logs to the collector; the gRPC service converts and persists telemetry, which API queries and UI panels expose for exploration, SQL, and YAML-defined dashboards. The graph follows explicit startup and frontend fetch paths; README-described capabilities are included where implementation excerpts were not sampled, using their documented enclosing modules.
Main entry points: App.tsx Web application · api.ts API client · api.rs REST router · grpc.rs OTLP gRPC
Components 22
Telemetry ingestion
- OTLP gRPC
src/grpc.rs - Signal conversion
src/convert.rs - OTLP types
src/proto.rs
Query and storage
- Server runtime
src/lib.rs - DuckDB store
src/db.rs - Telemetry rows
src/rows.rs - REST router
src/api.rs - Query logic
src/queries.rs - SQL guard
src/sqlguard.rs - Dashboard definitions
src/dashboards.rs
Viewer experience
- Web application
web/src/App.tsx - Global controls
web/src/components/AppHeader.tsx - Signal panels
web/src/components/panels/TracesPanel.tsx - Logs panel
web/src/components/panels/LogsPanel.tsx - Metrics panel
web/src/components/panels/MetricsPanel.tsx - SQL console
web/src/components/panels/SqlPanel.tsx - Dashboard viewer
web/src/components/panels/DashboardsPanel.tsx - API client
web/src/lib/api.ts
Desktop shell
- Tauri desktop
src-tauri/src/lib.rs - Native webview
src-tauri/src/lib.rs
Other components
- OTLP exporters
- Viewer user
Connections 30
- OTLP exporters → OTLP gRPC: export signals
- Server runtime → OTLP gRPC: starts receiver
- Server runtime → REST router: starts HTTP
- OTLP gRPC → OTLP types: decodes OTLP
- OTLP gRPC → Signal conversion: converts signals
- OTLP gRPC → DuckDB store: persists telemetry
- Signal conversion → Telemetry rows: builds rows
- REST router → Query logic: runs queries
- REST router → SQL guard: validates SQL
- REST router → Dashboard definitions: lists dashboards
- Query logic → DuckDB store: reads telemetry
- SQL guard → DuckDB store: executes SQL
- Web application → Global controls: renders controls
- Web application → Signal panels: renders traces
- Web application → Logs panel: renders logs
- Web application → Metrics panel: renders metrics
- Web application → SQL console: renders console
- Web application → Dashboard viewer: renders dashboards
- Global controls → API client: fetches status
- Global controls → API client: resets data
- Signal panels → API client: fetches traces
- Logs panel → API client: fetches logs
- Metrics panel → API client: fetches metrics
- SQL console → API client: submits SQL
- Dashboard viewer → API client: fetches dashboards
- API client → REST router: HTTP requests
- Viewer user → Web application: explores telemetry
- Tauri desktop → Server runtime: runs in process
- Tauri desktop → REST router: serves router
- Native webview → Tauri desktop: scheme requests