def test_msgfmt(self):
     event = PrometheusAlertManagerEvent.start(raw_alert=RAW_ALERT)
     self.assertEqual(
         str(event),
         "(PrometheusAlertManagerEvent Severity.WARNING): alert_name=InstanceDown type=start"
         " start=2019-12-24T17:00:09.591Z end=2019-12-26T06:21:09.591Z"
         " description=[10.0.201.178] has been down for more than 30 seconds. updated=2019-12-26T06:18:09.593Z"
         " state= fingerprint=None labels={'alertname': 'InstanceDown', 'instance': '[10.0.201.178]',"
         " 'job': 'scylla', 'monitor': 'scylla-monitor', 'severity': '2'}")
     self.assertEqual(event, pickle.loads(pickle.dumps(event)))
Exemple #2
0
 def _publish_new_alerts(self, alerts: dict):  # pylint: disable=no-self-use
     for alert in alerts.values():
         PrometheusAlertManagerEvent.start(raw_alert=alert).publish()