Skip to Content
IntegrationMetrics IngestionOverview

Metrics Ingestion

Send canonical metrics to ModularIoT. This section covers the ingestion workflow, mapping strategies, and best practices for high-quality metric data.

The Canonical Contract

When you send metrics to ModularIoT, you’re making a contract:

  • Correct key from the metrics registry
  • Correct unit (always canonical—km/h, °C, L)
  • Valid timestamp (device time, ISO 8601)
  • Plausible value (within expected ranges)

ModularIoT validates every metric against this contract. Invalid data is rejected with specific error codes.

Ingestion Workflow

Your Device → Driver/SDK → Canonical Metrics → ModularIoT API • Parse raw data • Convert units • Map to canonical keys • Validate ranges

The driver or SDK is responsible for transformation. ModularIoT receives clean, canonical data.

Where Conversion Happens

Unit conversion and key mapping happen at the edge, not in ModularIoT:

ResponsibilityWhere
Parse device protocolDriver/SDK
Convert mph → km/hDriver/SDK
Map spdvehicle.speedDriver/SDK
Validate rangesDriver/SDK + ModularIoT
Store and processModularIoT

This design keeps ModularIoT simple and pushes complexity to where it belongs—close to the device.

Sparse Metrics

Send only what you have. Not all devices support all metrics.

A basic GPS tracker might send:

{ "metrics": [ { "key": "position.latitude", "value": 37.7749 }, { "key": "position.longitude", "value": -122.4194 }, { "key": "vehicle.speed", "value": 65 } ] }

An OBD-II reader adds engine data:

{ "metrics": [ { "key": "engine.rpm", "value": 2500 }, { "key": "engine.coolant_temp", "value": 85 }, { "key": "fuel.level", "value": 72 } ] }

Both are valid. ModularIoT accepts whatever canonical metrics are available.

In This Section

  • MIOT Metrics Schema - The canonical JSON schema for metric payloads
  • Canonical Keys - Complete registry of supported metric keys with mapping guidance
  • Validation Rules - Range checks, timestamp rules, and error handling

Quick Reference

TopicGo Here
What metrics exist?Reference > Metrics Registry
Schema specificationMIOT Metrics Schema
OBD-II PID mappingCanonical Keys
Error codesReference > Error Codes
Last updated on