phury
phury

Reputation: 2203

Spring boot admin with Eureka client and custom context path fails on health status

I have configured my spring boot application monitor-client to register to Eureka. I have a separate spring boot admin (SBA) application monitor that monitors all applications registered to Eureka.

If the context-path is not set in my application, everything is working fine. However if the context-path is set, SBA does not show correct information anymore. From the documentation it seems that I need to update the metadata properties of Eureka which I have done.

My monitor application is configured as follows:

application.properties:

spring.application.name=monitor-client
server.servlet.context-path=/monitor-client
server.port=9876

# Monitoring config
management.endpoints.web.exposure.include=*
eureka.instance.metadataMap.management.context-path=/monitor-client/actuator

My application is showing as 'offline' but I can browse all the details in the 'insight' tab. I suppose SBA correctly access the actuator endpoints but incorrectly uses the /health endpoint and I do not understand how that is possible?

If I go to the administration interface of SBA, I notice that the wrench endpoint and the health endpoint are not the same:

I've fiddled around with some settings but between the managment settings, the actuator settings and the eureka settings, I'm not sure which one is to be configured for this to work.

I've tried:

I'm currently using spring boot 2.1.2.RELEASE and matching version of SBA

Upvotes: 2

Views: 3034

Answers (1)

Patan
Patan

Reputation: 17893

Can you try with these configuration

server:
  servlet:
    context-path: /monitor-client

#management config
eureka:
  instance:
    health-check-url-path: /actuator/health
    metadata-map:
      management.context-path: /monitor-client/actuator
  client:
    serviceUrl:
      defaultZone: ${EUREKA_SERVICE_URL:http://localhost:8761}/eureka/

management:
  endpoint:
    health:
      show-details: always
  endpoints:
    web:
      base-path: /actuator
      exposure:
        include: "*"

Upvotes: 2

Related Questions