Spring-boot-admin: properties not used spring.boot.admin.client.service-url

Created on 20 Jul 2017  路  7Comments  路  Source: codecentric/spring-boot-admin

spring boot version : 1.5.1
spring boot admin : 1.5.2
I use SBA with eureka, not SBA client.
The SBA server set properties
management.context-path=/monitor
When I set properties
spring.boot.admin.client.service-url=http://hostname:8080/registry , spring.boot.admin.client.management-url
spring.boot.admin.client.health-url,
at one service which registry to the eureka. The SBA server resolve the
serviceUrl=http://hostname:8080.
So the SBA UI can't get the service's info or heath.
I have seen the Admin Starter Client ignoring Service, and try
spring.boot.admin.client.ignoreUnknownFields=true,
It still wrong.
How can I set the properties?

Most helpful comment

As I said you need to set eureka.instance.metadata-map.management.context-path and eureka.instance.metadata-map.management.context-port

All 7 comments

The spring.boot.admin.client.* properties aren't taken into account when you are using eureka. You need to set the management.context-path / management.porton your eureka instance metadata (see http://cloud.spring.io/spring-cloud-static/spring-cloud-netflix/1.3.1.RELEASE/#_eureka_metadata_for_instances_and_clients and http://codecentric.github.io/spring-boot-admin/1.5.2/#spring-cloud-discovery-support)

I have done that with setting properties
eureka.instance.statusPageUrlPath=/registry/info, eureka.instance.healthCheckUrlPath=/registry/health, eureka.instance.homePageUrlPath=/registry
But the SBA server log show
managementUrl=http://hostname:8080, healthUrl=http://hostname:8080/registry/health, serviceUrl=http://hostname:8080],
there is only healthUrl changed, so the SBA UI only shows health.
I find source the eureka InstanceInfoand the SBA server Application. it has different key between class, such as homePageUrl and serviceUrl.
Is this bug? or how can i set properties.

As I said you need to set eureka.instance.metadata-map.management.context-path and eureka.instance.metadata-map.management.context-port

Thank you for your help.
I considermanagement.context-path firstly, so got the wrong result.
By the way, you can add it to document.

The metadata options are in the guide. There is no section on how to add metadata to eureka - since there are many spring cloud discovery client implementations. That's why I've posted two links which just need to be read carefully.

oh! I see this properties now.
Read carefully is very very very important.

Thanks for pointing out the metadata options. Small amendment, I believe eureka.instance.metadata-map.management.context-port should be eureka.instance.metadata-map.management.port. At least that's what works for me.

As I said you need to set eureka.instance.metadata-map.management.context-path and eureka.instance.metadata-map.management.context-port

Was this page helpful?
0 / 5 - 0 ratings