Telemetry
Device telemetry collection, command dispatch, and insights analysis.
Source: src/telemetry/
Services: TelemetryService, TelemetryInsightsService
API Endpoints
| Method | Endpoint | Auth | Description |
|---|---|---|---|
POST | /telemetry | Device Auth | Process incoming telemetry |
POST | /telemetry/command | Device Auth | Send command to device |
GET | /telemetry/metrics/:deviceId | JWT | Get device metrics |
GET | /telemetry/status/:deviceId | JWT | Get device status |
GET | /telemetry/stats | JWT | Aggregate statistics |
GET | /telemetry/alerts | JWT | Active telemetry alerts |
GET | /telemetry/history/:deviceId | JWT | Historical telemetry data |
GET | /telemetry/export | JWT | Export telemetry data |
POST | /telemetry/log-command | JWT | Log a command execution |
Mixed Authentication
Some endpoints use @Public() + DeviceAuthGuard for device-to-server communication, while others use standard JWT authentication for dashboard access.
Key Service Methods
TelemetryService
| Method | Description |
|---|---|
processTelemetry(data) | Ingest and store device telemetry |
sendCommand(deviceId, cmd) | Dispatch command to device |
getMetrics(deviceId) | Retrieve current metrics |
getStatus(deviceId) | Get device online/offline status |
getAlerts() | List active telemetry alerts |
getHistory(deviceId) | Historical data with time range |
exportData(filters) | Export filtered telemetry |
logCommand(entry) | Record command execution |
TelemetryInsightsService
Aggregation and analysis layer on top of raw telemetry data — provides trends, averages, and anomaly flags.
Data Flow
Device → POST /telemetry → TelemetryService.processTelemetry()
│
┌─────────────┼─────────────┐
▼ ▼ ▼
Store in DB Emit Event Check Alerts
(DeviceMetrics) (telemetry.*) (SmartAlerts)
Related Modules
DeviceMetricsModule— Persistent metrics storageSmartAlertsModule— Alert evaluation on telemetry eventsMqttModule— Alternative telemetry transport