prometheus/web/api/v1
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
..
api.go Add notifications to the web UI when configuration reload fails. 2024-09-27 15:28:38 +02:00
api_test.go chore: Fix typos (#14868) 2024-09-10 22:32:03 +02:00
codec.go Implement fully-featured content negotiation for API requests, and allow overriding the default API codec. 2023-03-09 12:02:45 +11:00
codec_test.go Implement fully-featured content negotiation for API requests, and allow overriding the default API codec. 2023-03-09 12:02:45 +11:00
errors_test.go Add notifications to the web UI when configuration reload fails. 2024-09-27 15:28:38 +02:00
json_codec.go bugfix: add missing comma in vector/matrix array (#14047) 2024-05-03 14:07:49 -03:00
json_codec_test.go bugfix: add missing comma in vector/matrix array (#14047) 2024-05-03 14:07:49 -03:00
translate_ast.go Signed-off-by: Julius Volz <julius.volz@gmail.com> 2024-09-06 21:47:35 +02:00