Annotation 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 ElementsModifier and TypeOptional ElementDescriptionbooleanIftrue, 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 nameLogical 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 alertOnSlowResponseIftrue, an additional alert is sent when the response time of this endpoint exceeds the threshold defined in@Sla.- Default:
false
-