prometheus/web/api
Julien 6cde0096e2 Add notifications to the web UI when configuration reload fails.
This commit introduces a new `/api/v1/notifications/live` endpoint that
utilizes Server-Sent Events (SSE) to stream notifications to the web UI.
This is used to display alerts such as when a configuration reload
has failed.

I opted for SSE over WebSockets because SSE is simpler to implement and
more robust for our use case. Since we only need one-way communication
from the server to the client, SSE fits perfectly without the overhead
of establishing and maintaining a two-way WebSocket connection.

When the SSE connection fails, we go back to a classic
/api/v1/notifications API endpoint.

This commit also contains the required UI changes for the new Mantine UI.

Signed-off-by: Julien <roidelapluie@o11y.eu>
2024-09-27 15:28:38 +02:00
..
v1 Add notifications to the web UI when configuration reload fails. 2024-09-27 15:28:38 +02:00
notifications.go Add notifications to the web UI when configuration reload fails. 2024-09-27 15:28:38 +02:00
notifications_test.go Add notifications to the web UI when configuration reload fails. 2024-09-27 15:28:38 +02:00