codecentric / spring-boot-admin

Admin UI for administration of spring boot applications
Apache License 2.0
12.34k stars 3.08k forks source link

Based on nacos monitoring, the service has a content-path path, resulting in the failure to access the correct address. #3220

Closed JavaLionLi closed 6 months ago

JavaLionLi commented 6 months ago

Spring Boot Admin Server information

Client information

Description

The spring-boot-admin-server discovers and monitors the service based on nacos. nacos can only obtain the ip and port of the service. In fact, the service also has the corresponding path content-path, which leads to the 404 of the monitoring service. No way has been found to solve this problem. I hope the author can help me think of some way.

Client yml image

Path should be accessed http://localhost:8800/easy-retry/actuator

Actual Access Path http://localhost:8800/actuator

hzpz commented 6 months ago

As you already figured out: If you set the servlet context-path you will also implicitly change the management context-path (unless you have a separate management port configured).

Spring Boot Admin uses instance metadata to discover things like the management port and context-path (see section "Converting ServiceInstances" in our documentation). To make your setup work, you need to set management.context-path in your service's metadata:

spring:
  cloud:
    nacos:
      discovery:
        metadata:
          management.context-path: /easy-entry/actuator

Please let me know if that helps.

JavaLionLi commented 6 months ago

thanks