Skip to content

notifications: use always time.Now() for event IDs#1150

Merged
yhabteab merged 1 commit into
mainfrom
more-unique-event-ids
Jul 14, 2026
Merged

notifications: use always time.Now() for event IDs#1150
yhabteab merged 1 commit into
mainfrom
more-unique-event-ids

Conversation

@yhabteab

Copy link
Copy Markdown
Member

Previously, the LastStateChange column was used to generate the event ID, but this is not reliable for events other than state changes, as the checkable can be ACKED, set in Downtime etc. while still being in the same problem state, thus the LastStateChange timestamp does not change. So, we now use the current timestamp in milliseconds to generate a unique event ID for each event, as everything sent to Icinga Notifications is considered a new event, even if the checkable is still in the same state.

I've just merged #1148 without actually testing it, I only noticed this again when I was testing the HA related in Icinga Notifications.

Previously, the LastStateChange column was used to generate the event
ID, but this is not reliable for events other than state changes, as the
checkable can be ACKED, set in Downtime etc. while still being in the
same problem state, thus the LastStateChange timestamp does not change.
So, we now use the current timestamp in milliseconds to generate a
unique event ID for each event, as everything sent to Icinga
Notifications is considered a new event, even if the checkable is still
in the same state.
@yhabteab yhabteab added this to the 1.6.0 milestone Jul 14, 2026
@yhabteab
yhabteab requested a review from oxzi July 14, 2026 07:09
@cla-bot cla-bot Bot added the cla/signed label Jul 14, 2026
@yhabteab yhabteab moved this from Todo to In progress in Icinga Notifications 1.0 Jul 14, 2026
@yhabteab yhabteab self-assigned this Jul 14, 2026
Comment thread pkg/notifications/notifications.go
@yhabteab
yhabteab merged commit 7c531b4 into main Jul 14, 2026
31 checks passed
@yhabteab
yhabteab deleted the more-unique-event-ids branch July 14, 2026 13:02
@github-project-automation github-project-automation Bot moved this from In progress to Done in Icinga Notifications 1.0 Jul 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants