Annotation Interface Sla


@Target({}) @Retention(RUNTIME) @Documented public @interface Sla
Defines the Service Level Agreement (SLA) for a microservice.

Used exclusively as an attribute of the @MonitoredMicroservice annotation. The monitoring system automatically calculates SLA compliance over different time windows (hour, day, week, month) and records breaches.

Usage example:


 @MonitoredMicroservice(
     name = "order-service",
     sla = @Sla(
         uptimePercent       = 99.9,
         maxResponseTimeMs   = 300,
         maxErrorRatePercent = 1.0,
         description         = "Production SLA for order processing"
     )
 )
 @SpringBootApplication
 public class OrderServiceApplication { ... }
 
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    Human-readable description of the agreement shown in reports.
    double
    Maximum allowed error rate as a percentage of total requests.
    long
    Maximum allowed average response time in milliseconds.
    double
    Minimum required uptime percentage.
  • Element Details

    • uptimePercent

      double uptimePercent
      Minimum required uptime percentage. Defaults to 99.9% (three nines).
      Default:
      99.9
    • maxResponseTimeMs

      long maxResponseTimeMs
      Maximum allowed average response time in milliseconds. Defaults to 1000ms.
      Default:
      1000L
    • maxErrorRatePercent

      double maxErrorRatePercent
      Maximum allowed error rate as a percentage of total requests. Defaults to 5.0%.
      Default:
      5.0
    • description

      String description
      Human-readable description of the agreement shown in reports.
      Default:
      ""