Class SlaDefinition

java.lang.Object
com.nmontytskyi.monitoring.model.SlaDefinition

public class SlaDefinition extends Object
Holds the Service Level Agreement (SLA) parameters for a microservice.

Can be created from an Sla annotation using from(Sla), or manually via the Builder. If a service does not define its own SLA, the default values from defaults() are used.

Stored together with ServiceInfo and used by AlertEvaluationService to evaluate metric compliance.

  • Constructor Details

    • SlaDefinition

      public SlaDefinition()
  • Method Details

    • from

      public static SlaDefinition from(Sla sla)
      Creates a SlaDefinition from the values of an Sla annotation.
      Parameters:
      sla - annotation defined on @MonitoredMicroservice
      Returns:
      an SLA parameters object
    • defaults

      public static SlaDefinition defaults()
      Returns an SLA with standard default values for services that have not defined their own agreement.
      • Uptime: 99.9%
      • Max response time: 1000ms
      • Max error rate: 5.0%