Annotation Interface MonitoredEndpoint


@Target({METHOD,TYPE}) @Retention(RUNTIME) @Documented public @interface MonitoredEndpoint
Marks a REST controller method for individual endpoint monitoring.

Used together with @MonitoredMicroservice(trackAllEndpoints = false) when selective monitoring of specific endpoints is preferred over monitoring all of them. If trackAllEndpoints = true this annotation is not required, but can still be used to override the name or settings for a specific method.

Usage example:


 @RestController
 public class OrderController {

     @MonitoredEndpoint
     @PostMapping("/orders")
     public Order createOrder(@RequestBody OrderRequest request) { ... }

     @MonitoredEndpoint(name = "get-all-orders", alertOnSlowResponse = true)
     @GetMapping("/orders")
     public List<Order> getOrders() { ... }
 }
 
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    boolean
    If true, an additional alert is sent when the response time of this endpoint exceeds the threshold defined in @Sla.
    Logical name of the endpoint in the monitoring system.
  • Element Details

    • name

      String name
      Logical name of the endpoint in the monitoring system. If not specified, the HTTP method and path are used (e.g. "GET /orders").
      Default:
      ""
    • alertOnSlowResponse

      boolean alertOnSlowResponse
      If true, an additional alert is sent when the response time of this endpoint exceeds the threshold defined in @Sla.
      Default:
      false