1

We work on the integration layer where we interact with other services to complete the workflow. Most of the applications we have built are scheduled to trigger the workflow (spring scheduler). Sometimes these external services may be down for unknown reasons (downtime, cert expiration, etc.) which usually impacts the workflow which we don't want. We use spring reactive web clients to interact with these services so I would like to know if the web client has any build-in metrics which can be used to monitor these services. We are more interested from a client/consumer standpoint because not every interacting service can provide a health-check end point of some sort.

Note: A crude solution for this would be to build a heartbeat or pulse call to check every second the service health by ourselves. I am trying to understand if there is an easier way to do this.

Snehal S
  • 21
  • 2

1 Answers1

1

Out of the box, the WebClient provides metrics for each http call made. The default metric name is http.client.requests and the default tags are:

  • clientName
  • method
  • outcome
  • status
  • uri

Please see HTTP Client Metrics Reference Docs for more details.

With regards to your question around a healthcheck to your downstream services - no, spring boot does not provide this for you out of the box, however it does provide an interface, ReactiveHealthIndicator, and you can provide your own implementation. The status of your custom health indicator will then be exposed on the actuator health check endpoint (/actuator/health). See Reactive Health Indicators Docs

Michael McFadyen
  • 2,675
  • 11
  • 25