question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Instance metadata's management.context-path doesn't get detected by spring boot admin's DiscoveryListener

See original GitHub issue

So, as per http://codecentric.github.io/spring-boot-admin/1.3.3/#spring-cloud-discovery-support

Since my management context path is different than root since the client app is a war, we have a diff context path , so I tried to set in the meta data map in my client.

## Eureka client properties ##
eureka.instance.metadataMap.instanceId=${spring.application.name}:${spring.application.instance_id}
eureka.instance.metadataMap.management.context-path=/sample
eureka.instance.nonSecurePort=8101
eureka.client.serviceUrl.defaultZone=http://localhost:8761/eureka/
eureka.client.registerWithEureka: true
eureka.client.fetchRegistry: true

My Server config

@SpringBootApplication
@EnableEurekaServer
@EnableAdminServer
@EnableDiscoveryClient
public class PlatformApplication {}

Server props

eureka:
  instance:
    hostname: localhost
  client:
    registerWithEureka: true
    fetchRegistry: true
    serviceUrl:
      defaultZone: http://${eureka.instance.hostname}:${server.port}/eureka/
  server:
    enableSelfPreservation: false      

spring.boot.admin.context-path: /admin
spring.boot.admin.hazelcast.enabled: false

Spring Cloud Version on the server component : Brixton.SR6 Admin Server Version : 1.3.7

It still doesnt return the managementUrl appended to the management context path from the instance metadata of the client. I checked the api response of admin. Am I missing something ? And I think thats why it is showing OFFLINE in the admin UI.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
joshistecommented, Nov 21, 2016

I thought, SBA will guess the actuator endpoints like metrics, health etc… based on the server.context-path if provided in the client. And in the client if management.context-path is given, I thought it would guess based on that. Adding all of them explicitly within eureka client config, is it really necessary?

When using Eureka the SBA server can only use the information published by the Eureka registry: the healthCheckUrlPath and the service url (doesn’t contain the servlet.context-path!) - so these need to be correct (and you need to set the healthCheckUrlPath explicitly when using non default context-path, see http://cloud.spring.io/spring-cloud-netflix/spring-cloud-netflix.html#_status_page_and_health_indicator).

In this case SBA server can’t guess anything based on the server.context-path or management.context-path, since it simply doesn’t know about the values for the registered application. This would only apply if you are using the SBA client - then the client computes the correct urls and uses them to register at the server…)

0reactions
sallampallicommented, Nov 21, 2016

@joshiste : Makes sense ! Thank you !

Read more comments on GitHub >

github_iconTop Results From Across the Web

codecentric/spring-boot-admin - Gitter
I found the solution and share it with every body. into application.properties. management.port=9086 management.context-path=/manage eureka.instance.
Read more >
Spring Boot Admin Client showing only details when there is ...
At my case I only point eureka.instance.metadata-map.management.context-path at ${service.servlet.context-path}/actuator
Read more >
Spring Boot Admin Reference Guide - GitHub Pages
codecentric's Spring Boot Admin is a community project to manage and monitor your Spring Boot ® applications. The applications register with our ...
Read more >
Index (GigaSpaces 15.8.0 API)
Encapsulates information about an index segment of a compound index. AbstractCompoundIndexSegment() - Constructor for class com.gigaspaces.metadata.index.
Read more >
Simple Spring Boot Admin Setup - Bozho's tech blog
context-path =/manage in your application properties file. Now that the actuator endpoints are setup, we have to attach our spring admin ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found