Skip to Content
ReferenceMetrics Registry

Metrics Registry

The authoritative catalog of all canonical metric keys supported by ModularIoT. This is the source of truth for metric validation.

Registry Overview

ModularIoT defines 31 canonical metrics organized into 7 categories:

CategoryCountPurpose
Powertrain8Engine performance and health
Fuel5Energy consumption and efficiency
Motion4Vehicle movement and behavior
Diagnostics4Fault detection and maintenance
Emissions4Environmental compliance
Electrical3Electrical system state
Identity3Vehicle identification

Key Format

All keys follow the pattern category.metric or category.subcategory:

engine.rpm ← category.metric fuel.trim.short ← category.subcategory.metric engine.coolant_temp ← category.metric (underscores within component)

Keys are lowercase, use dots as separators, and underscores within components.


Powertrain Metrics

Engine performance and operational parameters.

KeyTypeUnitRangeDescription
engine.rpmNUMBERrpm0–8,000Engine speed in revolutions per minute
vehicle.speedNUMBERkm/h0–300Ground speed from vehicle bus
engine.loadNUMBER%0–100Calculated engine load percentage
throttle.positionNUMBER%0–100Throttle plate opening percentage
engine.coolant_tempNUMBER°C-40–150Coolant temperature
engine.intake_air_tempNUMBER°C-40–80Intake manifold air temperature
engine.runtimeNUMBERs0–∞Engine run time since ignition on
engine.total_runtimeNUMBERh0–∞Cumulative engine hours (lifetime)

OBD-II / J1939 Sources

MetricOBD-II PIDJ1939 SPNNotes
engine.rpm0x0C190PID formula: (A×256+B)/4
vehicle.speed0x0D84PID: direct byte value
engine.load0x0492PID: A×100/255
throttle.position0x1151PID: A×100/255
engine.coolant_temp0x05110PID: A-40
engine.intake_air_temp0x0F105PID: A-40
engine.runtime0x1FPID: (A×256+B)
engine.total_runtime247J1939 only

Fuel Metrics

Fuel system and energy consumption.

KeyTypeUnitRangeDescription
fuel.levelNUMBER%0–100Fuel tank level percentage
fuel.rateNUMBERL/h0–100Instantaneous fuel consumption rate
fuel.usedNUMBERL0–∞Cumulative fuel consumed (trip or lifetime)
battery.voltageNUMBERV0–30ECU/system battery voltage
engine.torque_pctNUMBER%0–100Engine torque as percentage of reference

OBD-II / J1939 Sources

MetricOBD-II PIDJ1939 SPNNotes
fuel.level0x2F96PID: A×100/255
fuel.rate0x5E183PID: (A×256+B)/20 (L/h)
fuel.used250J1939: cumulative
battery.voltage0x42168PID: (A×256+B)/1000
engine.torque_pct0x62513Actual torque %

Motion Metrics

Vehicle movement and driver behavior.

KeyTypeUnitRangeDescription
odometerNUMBERkm0–∞Total vehicle distance traveled
idle.stateBOOLEANtrue/falseEngine running with near-zero speed
accelerator.positionNUMBER%0–100Accelerator pedal position
brake.stateBOOLEANtrue/falseBrake pedal depressed

OBD-II / J1939 Sources

MetricOBD-II PIDJ1939 SPNNotes
odometer0xA6245Service 01 or 09
idle.stateDerived: rpm>0 && speed≈0
accelerator.position0x4991PID: A×100/255
brake.state597J1939 brake switch

Diagnostics Metrics

Fault detection and maintenance indicators.

KeyTypeUnitRangeDescription
dtc.mil_onBOOLEANtrue/falseMalfunction Indicator Lamp (check engine)
dtc.codesARRAYstring[]Active diagnostic trouble codes
dtc.countNUMBERcount0–∞Number of stored DTCs
engine.freeze_frameOBJECTobjectSnapshot of metrics at fault occurrence

OBD-II / J1939 Sources

MetricOBD-II PIDJ1939 SPNNotes
dtc.mil_on0x011213Bit 7 of byte A
dtc.codesService 03DM1Mode 03 stored codes
dtc.count0x01Bits 0-6 of byte A
engine.freeze_frameService 02Snapshot at fault

DTC Code Format

Codes follow SAE J2012 format: P0301, C1234, B0100, U0073

{ "key": "dtc.codes", "value": ["P0301", "P0420", "P0171"] }

Emissions Metrics

Emissions control and environmental compliance.

KeyTypeUnitRangeDescription
fuel.trim.shortNUMBER%-100–100Short-term fuel trim (STFT)
fuel.trim.longNUMBER%-100–100Long-term fuel trim (LTFT)
lambdaNUMBERratio0–2Air-fuel equivalence ratio (λ)
catalyst.tempNUMBER°C0–1,000Catalytic converter temperature

OBD-II / J1939 Sources

MetricOBD-II PIDJ1939 SPNNotes
fuel.trim.short0x06, 0x08(A-128)×100/128
fuel.trim.long0x07, 0x09(A-128)×100/128
lambda0x24–0x2BCalculated
catalyst.temp0x3C, 0x3E(A×256+B)/10 - 40

Fuel Trim Interpretation

STFT ValueMeaning
-25% to -10%Rich condition (reducing fuel)
-10% to +10%Normal operation
+10% to +25%Lean condition (adding fuel)
Beyond ±25%Potential fault

Electrical Metrics

Electrical system and accessories.

KeyTypeUnitRangeDescription
battery.currentNUMBERA-100–100Battery current (negative = discharging)
pto.stateBOOLEANtrue/falsePower take-off engaged
engine.fan.stateBOOLEANtrue/falseCooling fan active

J1939 Sources

MetricJ1939 SPNNotes
battery.current114Signed value
pto.state976PTO engagement
engine.fan.state975Fan drive state

Identity Metrics

Vehicle identification (typically queried once per session).

KeyTypeUnitRangeDescription
vehicle.vinSTRING17 charsVehicle Identification Number
vehicle.protocolSTRINGOBD/CAN protocol detected
vehicle.ecuSTRINGECU identifier or address

OBD-II Sources

MetricOBD-II ServiceNotes
vehicle.vinService 09 PID 0217-character VIN
vehicle.protocolAuto-detectISO 9141, CAN, etc.
vehicle.ecuService 09 PID 0ACalibration ID

Extension Keys (Custom Metrics)

For vendor-specific or custom metrics not in the canonical registry, use the x. prefix:

x.teltonika.din1 ← Digital input 1 state x.queclink.report_type ← Queclink-specific report ID x.obd.mode6.test123 ← Custom on-board monitoring test x.fleet.driver_id ← Fleet-specific driver identifier

Extension Key Rules

RuleRequirement
PrefixMust start with x.
FormatLowercase, dots as separators
ValidationBypasses type and bounds checks
LoggingAlways logged for analysis

Extension keys are useful for:

  • Proprietary device fields
  • Fleet-specific business metrics
  • Protocol-specific raw values
  • Experimental metrics during development

Metric Lookup API

// Check if a key is canonical MetricRegistry.isKnownMetric("engine.rpm"); // true MetricRegistry.isKnownMetric("x.custom"); // false (extension key) // Get definition Optional<MetricDefinition> def = MetricRegistry.lookup("engine.rpm"); def.ifPresent(d -> { System.out.println(d.getUnit()); // "rpm" System.out.println(d.getMinValue()); // 0.0 System.out.println(d.getMaxValue()); // 8000.0 }); // Validate a metric item MetricValidationResult result = MetricRegistry.validate(item); if (!result.isValid()) { System.out.println(result.getErrorCode()); // "OUT_OF_BOUNDS" }

Version History

VersionDateChanges
1.02024-01Initial registry with 31 metrics

→ See Integration > Metrics Ingestion > Canonical Keys for OBD-II/J1939 conversion details

Last updated on