SBA doesn't display actuator endpoints for services (150+) discovered by Eureka registry
See original GitHub issueMain issue: I have 150+ Spring Boot microservices registered to Eureka. When I run SBA with cloud discovery, all services appear and show Details pages, but just a few of them show the other tabs (ENV, JMX, Loggers, …)
Initial configuration: Spring Boot Starter 2.0.5, Spring Boot Admin 2.0.3 (also compiled from sources based on 2.0.x branch). SBA discovery - Eureka
I have some investigations and want to share it. It can be useful or at least helps to determine what’s wrong with my assumptions:
- All instance endpoints register in
Instance
class :Instance apply(InstanceEvent event, boolean isNewEvent)
These events areInstanceRegistrationUpdatedEvent
,InstanceEndpointsDetectedEvent
and so on. As Eureka doesn’t send such events with filled endpoints, I decided to fix it with overridingInstanceDiscoveryListener
which allows me to force endpoints detection.
@Override
protected Mono<InstanceId> registerInstance(ServiceInstance instance) {
return super.registerInstance(instance)
.doOnNext(endpointDetector::detectEndpoints);
}
After that about half of the services show required tabs. Unfortunately, there are another half fo services are still with single Details
tab
- Despite the fix above there’s some magic is present here. After restarting SBA application some of previously “correctly worked” services show single
Details
tab, while some other “incorrectly worked” ones show full set of tabs. After next restart it repeats with other services. And so on.
While debug source code I noticed that ProbeEndpointsStrategy
detect actuator endpoints for all services, but then it cannot propagate next.
Moreover, the issue I found relates to this method:
public Mono<Endpoints> detectEndpoints(Instance instance) {
return Flux.fromIterable(endpoints) // 1
.flatMap(endpoint -> detectEndpoint(instance, endpoint))// 2
.collectList()// 3
.flatMap(this::convert);// 4
}
While after //1 and //2 all endpoints are present, // 3 step returns empty list unpredictably, so //4 doesn’t even run
I’ve shared all my investigations with you and I suppose some of them can be going in wrong direction, but anyway the issue is still exists
Issue Analytics
- State:
- Created 5 years ago
- Comments:11
Top GitHub Comments
see https://github.com/codecentric/spring-boot-admin/milestones
Johannes, can you tell me, please, when 2.1.0 release is planned?