AMRC-FactoryPlus / acs-edge

The Edge Agent component of the AMRC Connectivity Stack
https://github.com/AMRC-FactoryPlus/amrc-connectivity-stack
MIT License
0 stars 0 forks source link

Fixed UUIDs for Alerts #49

Closed amrc-benmorrow closed 8 months ago

amrc-benmorrow commented 10 months ago

The UUIDs generated for the Alerts raised by the Edge Agent currently change every time the Edge Agent is restarted. This is not ideal, as the Directory has no way of knowing the new alert is a replacement for the old and will keep indexing both.

Since we have no information available to us except our own UPN, UUID and Sparkplug address, I propose using v5 UUIDs under the following scheme:

So an alert based at Alerts/Config_Invalid for a device with uuid 11111111-2222-3333-4444-555555555555 would have a metric Alerts/Config_Invalid/Instance_UUID generated with

uuid.v5(
    "8a4dc2f4-2f9f-45fc-b2e9-ed7b9cda6145:11111111-2222-3333-4444-555555555555:Alerts/Config_Invalid",
    "11ad7b32-1d32-4c4a-b0c9-fa049208939a");
amrc-benmorrow commented 8 months ago

This needs moving to amrc-connectivity-stack.