Spring Boot Actuator + Spring Boot Admin - Is there a way to define a custom management url?

1/24/2019

Is there a way I can define the port for the management URLs (not the management.server.port) so that spring boot admin can identify the actuator URLs from the spring boot app for monitoring? I'm running the spring boot app in a docker container and it's externally exposed on a different port using the Kubernetes NodePort.

-- Zuke
kubernetes
netflix-eureka
spring-boot
spring-boot-actuator
spring-boot-admin

2 Answers

2/4/2019

If you are using Service Discovery, take a look into DefaultServiceInstanceConverter, try specifying the management.port property.
If you are not using Service Discovery, then take a look into de.codecentric.boot.admin.server.domain.values.Registration, you might need to use the builder apis to register your application correctly (try to set managementUrl properly). Note, you will need to do this in your client application (the one which is being monitored).

-- Sarvesh Dubey
Source: StackOverflow

1/24/2019

If you are using service discovery for application lookup you could define the exposed management port in instance metadata. This metadata is used to build up the management URL. More details documented here:

http://codecentric.github.io/spring-boot-admin/current/#spring-cloud-discovery-support

Handling is done in de.codecentric.boot.admin.server.cloud.discovery.DefaultServiceInstanceConverter

Example for Eureka: eureka.instance.metadata-map.management.port=[K8S-EXPOSED-PORT]

-- Stefan Rempfer
Source: StackOverflow