Skip to content
On this page

Data model

Alerts and links

How Sparkplug publishers report problems as alerts and relationships as links in their births, and how the Directory indexes and serves them.

10 min read Edit this page
ACS implementationACS DirectorySee how the AMRC Connectivity Stack implements this.View on GitHub

Alerts and links are objects in Sparkplug births that report problems and relationships.

An alert is a named condition that a publisher raises and clears, such as an Edge Agent that cannot read its configuration or a gateway that has gone offline. A link is a typed relationship from one object to another by UUID, such as the device that a monitor is watching. Each follows a library schema.

Because alerts and links travel in the birth and DATA messages a publisher already sends, any publisher can report them without a separate interface. The Directory collects them from every device, and a client can list the active alerts or follow links across the whole installation with one request.

Each alert and link is marked by the Schema_UUID and Instance_UUID metrics from the Sparkplug conventions.

A link is an object in a birth that follows the Link schema.

SchemaLink
b3c4b273-9528-45de-8842-9f77c9ef272a
An object link: a relation UUID and a target UUID. The object that contains the link is its source.

The Links schema (Common/Links-v1, UUID 2fed10c7-de5f-4023-89b7-9aeb10afe60b) describes a whole folder of links in one object. It is deprecated and replaced by Link. New publishers SHOULD NOT use it.

A link object has these metrics:

MetricDatatypeRequiredMeaning
<path>/Schema_UUIDUUIDYesb3c4b273-9528-45de-8842-9f77c9ef272a
<path>/Instance_UUIDUUIDYesThe link’s own UUID. It MUST stay the same in every birth.
<path>/RelationUUIDYesThe kind of relationship, as the UUID of a link relation.
<path>/TargetUUIDYesThe UUID of the object the link points to.

The source of a link is the nearest object that contains it and has its own Schema_UUID and Instance_UUID, which is usually the device itself. A link has no source metric, because its position in the birth already says where it comes from.

The library schemas give Relation and Target the String datatype. Publishers SHOULD use the Sparkplug UUID datatype for them. Consumers MUST accept either datatype. The Link schema lists only Target as required, but the Directory needs Relation too. A publisher MUST include both.

By convention a publisher puts its links in a Links folder, with one object per link. Each object is named after what the link means to the source. Schemas that allow links, such as Three Phase Circuit, declare that folder as a set of Link objects. A device whose UUID is 3c1f9a52-6b0e-4d8f-9a71-2e5c8b4d7f10 could declare a link to the Node it monitors like this:

Metric nameDatatypeValue
Links/Node/Schema_UUIDUUIDb3c4b273-9528-45de-8842-9f77c9ef272a
Links/Node/Instance_UUIDUUID80e546ac-656e-5ba3-ba5e-e251ebb1e34a
Links/Node/RelationUUIDec916189-f4f9-4fc7-af7e-724cc216e9e9 (Monitored Node)
Links/Node/TargetUUIDthe UUID of the monitored Node

The Instance_UUID here is the name-based (v5) UUID of the path Links/Node on that device. Because it is derived from the path, it stays the same in every birth without being stored.

A link relation is a UUID that says what kind of relationship a link is. Each relation is an object in the Configuration Store that belongs to the Link relation class. Because its name comes from the object’s General Information entry, a client can show a readable name for a relation it has not seen before. A site MAY define its own relations by creating objects in this class.

ClassLink relation
2bce9142-6b5b-4a5e-8e2f-f8a8d51d6c15
The class of link relations. Each member is a relation that a Sparkplug link can use.

This relation is well-known:

Link relationMonitored Node
ec916189-f4f9-4fc7-af7e-724cc216e9e9
The source monitors the target, which is a Sparkplug Node.

Alerts

An alert is an object in a birth that follows the Alert schema.

SchemaAlert
8853aa15-2228-4309-b98e-e086cefbc72c
An alert which can be raised by a Node or device: an alert type, an active flag and optional links.

An alert object has these metrics:

MetricDatatypeRequiredMeaning
<path>/Schema_UUIDUUIDYes8853aa15-2228-4309-b98e-e086cefbc72c
<path>/Instance_UUIDUUIDYesThe alert’s own UUID. It MUST stay the same in every birth. Clients use it to follow one alert over time.
<path>/TypeUUIDYesThe alert type.
<path>/ActiveBooleanYestrue while the condition holds, false when it does not.
<path>/Links/<name>/...NoLink objects whose source is the alert, which say what the alert is about.

The library schema gives Type the String datatype. Publishers SHOULD use the UUID datatype for Type. Consumers MUST also accept String.

A publisher declares in its birth every alert it may raise, with Active set to the current state. It publishes a change to Active in DATA whenever the condition starts or stops. If a new birth no longer declares an alert, that alert no longer exists. By convention alerts sit in an Alerts folder, with one object per alert. A monitor that reports whether a Node is online could declare:

Metric nameDatatypeValue
Alerts/Offline/Schema_UUIDUUID8853aa15-2228-4309-b98e-e086cefbc72c
Alerts/Offline/Instance_UUIDUUID4766937a-470c-5007-aa34-6724da353567
Alerts/Offline/TypeUUIDe6eff8b6-7b16-4827-9136-ac5202c0df59 (Offline)
Alerts/Offline/ActiveBooleanfalse
Alerts/Offline/Links/Node/Schema_UUIDUUIDb3c4b273-9528-45de-8842-9f77c9ef272a
Alerts/Offline/Links/Node/Instance_UUIDUUIDthe link’s UUID
Alerts/Offline/Links/Node/RelationUUIDec916189-f4f9-4fc7-af7e-724cc216e9e9 (Monitored Node)
Alerts/Offline/Links/Node/TargetUUIDthe UUID of the monitored Node

When the Node goes offline, the monitor publishes Alerts/Offline/Active = true in a DDATA message. When the Node comes back, the monitor publishes false.

Alert types

An alert type is a UUID that says what kind of problem an alert reports. Clients use it to filter alerts, or to decide who should see them, without parsing metric names. Each alert type is an object in the Configuration Store that belongs to the Alert type class. Its name comes from the object’s General Information entry. A publisher SHOULD use only alert types that exist in this class, because that is where clients find their names. A site MAY define its own alert types.

ClassAlert type
ddb853fc-262a-4a10-888a-816a961d37c5
The class of alert types. Each member is a kind of alert that a Sparkplug alert can report.

The Offline alert type reports that a Node or device has stopped publishing. A component that watches other Nodes, such as a monitor, raises it on a device of its own. The alert links to the watched Node with the Monitored Node relation. The watched Node cannot raise this alert itself, because it is the thing that has gone silent.

Alert typeOffline
e6eff8b6-7b16-4827-9136-ac5202c0df59
The Node or device that the alert links to has stopped publishing. Active while it is offline.

The Edge Agent defines three more alert types for its own problems:

Alert typeUUIDMeaning
Config unavailablec414c68b-5014-4e46-a0b4-d5f7f8df1d9fThe Edge Agent could not fetch its configuration.
Config invalid99c54cb2-2bb9-45c8-88f9-c1a0f792cfd6The Edge Agent’s configuration is not valid.
Connection problem633a7da3-ea2a-4e3f-8e84-35691a07465fThe Edge Agent could not start one of its device connections.

The Directory subscribes to every Sparkplug message and reads alerts and links from each Factory+ birth. Only births that carry the Factory+ birth marker are read, because the Directory relies on the Schema_UUID and Instance_UUID metrics.

  1. On a birth, the Directory walks the objects in the birth. Every object whose Schema_UUID is the Link schema becomes a link, with the nearest containing object as its source. Every object whose Schema_UUID is the Alert schema becomes an alert, with its type and its current Active value. Each is recorded against the device that published the birth.
  2. Alerts and links that the device declared in an earlier birth but not in this one are marked stale. The Directory no longer returns them.
  3. On a DATA message, the Directory matches each metric to the Active metric of a known alert by alias or by name. It updates the alert’s active state. The metric’s timestamp is recorded as the time of the last change. If the metric has no timestamp, the payload’s timestamp is used.
  4. On a death, the Directory stops matching DATA for that address until the next birth. It keeps the alerts and links, and each alert keeps the last state its publisher reported.

The loss of a publisher is therefore reported by an Offline alert from whatever watches it, not by the publisher’s own alerts.

Reading alerts

All the alert endpoints are under the Directory’s /v1 prefix and answer GET only.

PathReturns
/v1/alertEvery current alert the caller may read.
/v1/alert/activeEvery current alert the caller may read whose active is true.
/v1/alert/type/{type}The current alerts of one alert type.
/v1/alert/type/{type}/activeThe active alerts of one alert type.
/v1/alert/{uuid}One alert, or 404.

Each alert is a JSON object:

{
  "uuid": "4766937a-470c-5007-aa34-6724da353567",
  "device": "3c1f9a52-6b0e-4d8f-9a71-2e5c8b4d7f10",
  "type": "e6eff8b6-7b16-4827-9136-ac5202c0df59",
  "metric": "Alerts/Offline/Active",
  "active": true,
  "last_change": "2026-12-02T12:00:00.000Z",
  "links": ["d84cf063-356e-599a-a725-ab59951a68cf"]
}
FieldMeaning
deviceThe UUID of the device whose birth declared the alert.
metricThe full name of the alert’s Active metric.
last_changeWhen active last changed.
linksThe UUIDs of the links whose source is the alert.

The link endpoints are also under /v1 and answer GET only.

PathReturns
/v1/linkThe UUIDs of every current link the caller may read.
/v1/link/device/{device}The UUIDs of the links declared in that device’s births.
/v1/link/source/{source}The UUIDs of the links whose source is that object.
/v1/link/relation/{relation}The UUIDs of the links with that relation.
/v1/link/target/{target}The UUIDs of the links that point at that object.
/v1/link/{uuid}One link, or 404.

A single link is a JSON object:

{
  "uuid": "80e546ac-656e-5ba3-ba5e-e251ebb1e34a",
  "device": "3c1f9a52-6b0e-4d8f-9a71-2e5c8b4d7f10",
  "source": "3c1f9a52-6b0e-4d8f-9a71-2e5c8b4d7f10",
  "relation": "ec916189-f4f9-4fc7-af7e-724cc216e9e9",
  "target": "<UUID of the monitored Node>"
}

device is the device whose birth declared the link. source is the object that contains it. The two are the same when the link sits directly under the device, and differ when it sits under another object, such as an alert.

Permissions

The Directory filters alerts and links by the caller’s grants.

  • A caller may read an alert if it holds Read alerts of type for the alert’s type, or Read alerts from device for the device that declared it.
  • A caller may read a link if it holds Read links by relation for the link’s relation, or Read links from device for the device that declared it.

A grant with the wildcard target covers every type, relation or device. The list endpoints leave out what the caller may not read, and the single-item endpoints answer 404 rather than 403. Neither lets a caller find out which alerts or links exist.

PermissionRead alerts of type
7b096c2f-9f0e-4da4-a644-5bd647a530f6
Read alerts of the alert type given as the target.
PermissionRead alerts from device
7e25ba20-f118-41da-a438-a7205f33b232
Read alerts declared by the device given as the target.
PermissionRead links by relation
5a8defab-635f-46fa-8d1a-fbecaa1c2428
Read links with the relation given as the target.
PermissionRead links from device
b3dbdd15-f049-4a24-8ed3-9204537b8a22
Read links declared by the device given as the target.
PermissionPublish alerts of type
8bceb6c8-d330-4130-a732-8db4993234b1
Reserved for limiting which principals may publish alerts of the alert type given as the target. The Directory does not check it.

Change notification

The Directory announces changes to alerts and links on its own Sparkplug Node through Last_Changed metrics. This is change-notify version 0. Version 0 is deprecated for new services, but the Directory has no notify/v2 interface.

MetricValue
Last_Changed/Alert_TypeThe type UUID of an alert that changed
Last_Changed/Link_RelationThe relation UUID of a link that changed
Esc