Class Alerts.AlertSet

java.lang.Object
org.acemq.rabbitmq.admin.alerts.Alerts.AlertSet
Enclosing class:
Alerts

public static final class Alerts.AlertSet extends Object
Several rules, evaluated and exported together.
  • Method Details

    • of

      public static Alerts.AlertSet of(AlertRule... rules)
      Parameters:
      rules - the rules
      Returns:
      a set of them
    • and

      public Alerts.AlertSet and(AlertRule rule)
      Parameters:
      rule - another rule
      Returns:
      a set with it added
    • evaluate

      public List<AlertEvent> evaluate(MetricsSnapshot metrics)
      Parameters:
      metrics - a scrape
      Returns:
      every event firing across every rule, most severe first, so a caller printing the first line prints the worst thing rather than the first-declared thing
    • hasCritical

      public boolean hasCritical(MetricsSnapshot metrics)
      Parameters:
      metrics - a scrape
      Returns:
      whether anything is firing at Severity.CRITICAL
    • toPrometheusRules

      public String toPrometheusRules()
      Returns:
      a complete Prometheus rules file, ready to load
    • rules

      public List<AlertRule> rules()
      Returns:
      the rules in this set