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.
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.
Links
A link is an object in a birth that follows the Link schema.
b3c4b273-9528-45de-8842-9f77c9ef272aThe 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:
| Metric | Datatype | Required | Meaning |
|---|---|---|---|
<path>/Schema_UUID | UUID | Yes | b3c4b273-9528-45de-8842-9f77c9ef272a |
<path>/Instance_UUID | UUID | Yes | The link’s own UUID. It MUST stay the same in every birth. |
<path>/Relation | UUID | Yes | The kind of relationship, as the UUID of a link relation. |
<path>/Target | UUID | Yes | The 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 name | Datatype | Value |
|---|---|---|
Links/Node/Schema_UUID | UUID | b3c4b273-9528-45de-8842-9f77c9ef272a |
Links/Node/Instance_UUID | UUID | 80e546ac-656e-5ba3-ba5e-e251ebb1e34a |
Links/Node/Relation | UUID | ec916189-f4f9-4fc7-af7e-724cc216e9e9 (Monitored Node) |
Links/Node/Target | UUID | the 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.
Link relations
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.
2bce9142-6b5b-4a5e-8e2f-f8a8d51d6c15This relation is well-known:
ec916189-f4f9-4fc7-af7e-724cc216e9e9Alerts
An alert is an object in a birth that follows the Alert schema.
8853aa15-2228-4309-b98e-e086cefbc72cAn alert object has these metrics:
| Metric | Datatype | Required | Meaning |
|---|---|---|---|
<path>/Schema_UUID | UUID | Yes | 8853aa15-2228-4309-b98e-e086cefbc72c |
<path>/Instance_UUID | UUID | Yes | The alert’s own UUID. It MUST stay the same in every birth. Clients use it to follow one alert over time. |
<path>/Type | UUID | Yes | The alert type. |
<path>/Active | Boolean | Yes | true while the condition holds, false when it does not. |
<path>/Links/<name>/... | No | Link 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 name | Datatype | Value |
|---|---|---|
Alerts/Offline/Schema_UUID | UUID | 8853aa15-2228-4309-b98e-e086cefbc72c |
Alerts/Offline/Instance_UUID | UUID | 4766937a-470c-5007-aa34-6724da353567 |
Alerts/Offline/Type | UUID | e6eff8b6-7b16-4827-9136-ac5202c0df59 (Offline) |
Alerts/Offline/Active | Boolean | false |
Alerts/Offline/Links/Node/Schema_UUID | UUID | b3c4b273-9528-45de-8842-9f77c9ef272a |
Alerts/Offline/Links/Node/Instance_UUID | UUID | the link’s UUID |
Alerts/Offline/Links/Node/Relation | UUID | ec916189-f4f9-4fc7-af7e-724cc216e9e9 (Monitored Node) |
Alerts/Offline/Links/Node/Target | UUID | the 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.
ddb853fc-262a-4a10-888a-816a961d37c5The 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.
e6eff8b6-7b16-4827-9136-ac5202c0df59The Edge Agent defines three more alert types for its own problems:
| Alert type | UUID | Meaning |
|---|---|---|
| Config unavailable | c414c68b-5014-4e46-a0b4-d5f7f8df1d9f | The Edge Agent could not fetch its configuration. |
| Config invalid | 99c54cb2-2bb9-45c8-88f9-c1a0f792cfd6 | The Edge Agent’s configuration is not valid. |
| Connection problem | 633a7da3-ea2a-4e3f-8e84-35691a07465f | The Edge Agent could not start one of its device connections. |
How the Directory indexes alerts and links
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.
- On a birth, the Directory walks the objects in the birth. Every object whose
Schema_UUIDis the Link schema becomes a link, with the nearest containing object as its source. Every object whoseSchema_UUIDis the Alert schema becomes an alert, with its type and its currentActivevalue. Each is recorded against the device that published the birth. - 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.
- On a DATA message, the Directory matches each metric to the
Activemetric 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. - 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.
| Path | Returns |
|---|---|
/v1/alert | Every current alert the caller may read. |
/v1/alert/active | Every 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}/active | The 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"]
}
| Field | Meaning |
|---|---|
device | The UUID of the device whose birth declared the alert. |
metric | The full name of the alert’s Active metric. |
last_change | When active last changed. |
links | The UUIDs of the links whose source is the alert. |
Reading links
The link endpoints are also under /v1 and answer GET only.
| Path | Returns |
|---|---|
/v1/link | The 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.
7b096c2f-9f0e-4da4-a644-5bd647a530f67e25ba20-f118-41da-a438-a7205f33b2325a8defab-635f-46fa-8d1a-fbecaa1c2428b3dbdd15-f049-4a24-8ed3-9204537b8a228bceb6c8-d330-4130-a732-8db4993234b1Change 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.
| Metric | Value |
|---|---|
Last_Changed/Alert_Type | The type UUID of an alert that changed |
Last_Changed/Link_Relation | The relation UUID of a link that changed |