AlarmRule (v1.0.0)

Alarm rule definition

Defines an alarm threshold and conditions. Published to a compacted Kafka topic via the REST API and materialized as a GlobalKTable state store in the alarm-service.

Key Fields

FieldTypeDescription
ruleIdstringUUID identifier
ruleNamestringHuman-readable name
metricenumSCRAP_RATE, SCRAP_COUNT, SCRAP_VELOCITY_PER_HOUR, REWORK_COUNT, SCRAP_COUNT_BY_REASON_CODE
operatorenumGT, GTE, LT, LTE
thresholddoubleValue to compare against
lineIdstring (nullable)Null = applies to all lines
severityenumWARNING or CRITICAL
cooldownMinutesintHysteresis cooldown (default: 15)
enabledbooleanWhether the rule is active

Example

{
"ruleId": "rule-high-scrap-rate",
"ruleName": "High Scrap Rate",
"metric": "SCRAP_RATE",
"operator": "GT",
"threshold": 0.10,
"lineId": null,
"factoryId": null,
"reasonCode": null,
"cooldownMinutes": 15,
"severity": "WARNING",
"enabled": true
}