canonical / prometheus-k8s-operator

https://charmhub.io/prometheus-k8s
Apache License 2.0
21 stars 35 forks source link

Send events from `PrometheusRemoteWriteProvider` #440

Closed rbarry82 closed 1 year ago

rbarry82 commented 1 year ago

Issue

Currently, PrometheusRemoteWriteProvider, unlike the rest of our charms, does not send any events at all when the status changes.

It seems that the Prometheus charm listens/listened directly to events from that interface, and called a "common exit hook" which masked the issue by always re-reading alerts on every event.

Solution

Send events which can be watched, so charms and libraries keep their appropriate scope of responsibility. Otherwise, this library behaves differently from all of our others, and it's easy to "lose" or "drop" data.

Context

See the comments for Mimir here.

Testing Instructions

Deploy, listen to events, make sure things fire. Unit tests and integration tests were not changed, as "remove the raw listeners and they pass with the other event" is a reasonable assurance that this change did not break code/functionality.

Authors/users who were previously directly monitoring the relation still can, but now they don't have to.

Release Notes

Send events from PrometheusRemoteWriteProvider