Class AlertProcessMetaData


public class AlertProcessMetaData extends QSupplementalProcessMetaData
"Tell me when this process fails" and "tell me when it didn't run", by meta-data alone: process.withSupplementalMetaData(new AlertProcessMetaData() .withAlertOnFailure(AlertSeverity.ERROR) .withExpectedEvery(Duration.ofHours(24))); At enrichment this declares the alert types process.(name).failed (when alertOnFailure is set) and process.(name).missed (when expectedEvery is set, with a seeded heartbeat monitor), where (name) is the process name in lowercase-hyphen form, and registers AlertProcessLifecycleListener, which raises on failure, resolves on the next success and beats on success.
  • Field Details

  • Constructor Details

    • AlertProcessMetaData

      public AlertProcessMetaData()
  • Method Details

    • of

      public static AlertProcessMetaData of(QProcessMetaData process)
      The process's alerts meta-data, or null.
    • toTypeSegment

      public static String toTypeSegment(String processName)
      A process name as an alert-type segment: camelCase and anything that is not a letter or digit become lowercase words joined by hyphens (alertsEvaluateMonitors becomes alerts-evaluate-monitors).
    • failedTypeName

      public static String failedTypeName(String processName)
      The alert type raised when the process fails.
    • missedTypeName

      public static String missedTypeName(String processName)
      The alert type raised when the process has not completed in time.
    • heartbeatKey

      public static String heartbeatKey(String processName)
      The heartbeat key a successful run beats.
    • getType

      public String getType()
      Description copied from class: QSupplementalProcessMetaData
      Getter for type
      Specified by:
      getType in class QSupplementalProcessMetaData
    • enrich

      public void enrich(QInstanceEnricher qInstanceEnricher, QProcessMetaData process)
      Declare this process's alert types and register the lifecycle listener. Safe to run more than once.
      Overrides:
      enrich in class QSupplementalProcessMetaData
    • validate

      public void validate(QInstance qInstance, QProcessMetaData process, QInstanceValidator qInstanceValidator)
      Something must be asked for, and an interval must be positive.
      Overrides:
      validate in class QSupplementalProcessMetaData
    • getAlertOnFailure

      public AlertSeverity getAlertOnFailure()
      Getter for alertOnFailure
    • withAlertOnFailure

      public AlertProcessMetaData withAlertOnFailure(AlertSeverity alertOnFailure)
      Fluent setter for alertOnFailure - the severity of the alert raised when a run fails (null: don't alert on failure).
    • getExpectedEvery

      public Duration getExpectedEvery()
      Getter for expectedEvery
    • withExpectedEvery

      public AlertProcessMetaData withExpectedEvery(Duration expectedEvery)
      Fluent setter for expectedEvery - how often a successful run is expected (null: don't watch for missed runs).