Skip to content
Back to Knowledge Base

Understanding Metrics

Metrics are structured data points that devices send to CoCoCo during production. They capture the live state of your machines — what job is running, how fast, how many sheets printed, what errors occurred.

CoCoCo stores and processes Metrics so they can be used in Workflows, displayed in dashboards, and queried via GraphQL.

  1. A Device sends a Metric payload to CoCoCo via its configured protocol (MQTT, HTTP, etc.)
  2. CoCoCo receives and stores the Metric, associating it with the Device and the current Job if one is active
  3. Workflow triggers can react to new Metrics — for example, flagging a job when error count exceeds a threshold

A device publishes metrics to the relative topic s/metrics. The broker rewrites it to the absolute, tenant-scoped topic t/{tenant}/s/metrics — you publish to s/metrics and the platform fills in the tenant for you. There is no d/{id}/... topic; publishing there is silently dropped.

The payload is a batch of one or more points:

{
"points": [
{
"name": "door_open",
"value": 1,
"kind": "STATUS",
"unit": "BOOLEAN",
"tags": { "location": "front" },
"timestamp": "2026-02-08T12:00:00Z"
}
]
}
  • name — machine-readable metric identifier; the metric is auto-created by name per (tenant, device) the first time it is seen.
  • value — must be a finite number.
  • kind — optional (GAUGE, COUNTER, STATUS, RATE); only used when auto-creating. Defaults to GAUGE.
  • unit — optional; only used when auto-creating. Defaults to NONE.
  • tags — optional key-value labels for the point.
  • timestamp — optional ISO 8601 time; defaults to server time.

Enum values are UPPERCASE on the wire — send kind: "STATUS" and unit: "BOOLEAN", not lowercase.

Other channels: live job progress goes to the separate s/progress topic (rewritten to t/{tenant}/s/progress). Note that OpenInfra’s $rpc/metrics/ingest belongs to a different application and is not the CoCoCo metrics path described here.

  1. Go to Menu → IOT → Metrics
  2. Select a Device from the list
  3. Browse recent Metric values in the table

Metrics can trigger Workflow executions. Use a Device Metric trigger node and configure the conditions — for example:

  • sheets_printed > 1000 — trigger a quality check task
  • status == "error" — notify the production manager
  • job_id changed — start tracking a new job