Search code examples
javaspring-boot-admin

SpringBoot Admin - How to prevent SpringBoot Admin Server to register itself?


Small question regarding Spring Boot Admin (SBA) please.

I can register clients to SBA Server fine, very happy. Unfortunately, the server itself registers to itself.

The usage of SBA is to monitor and have information on the SBA clients. I am having a hard time getting the SBA Server to not register itself, but just accepting registrations from clients.

What is the best way to achieve this please?

In my app, I am having:

@EnableScheduling
@EnableAdminServer
@EnableDiscoveryClient
@SpringBootApplication
public class MyApplication {

Thank you


Solution

  • In your admin server properties, you can either use spring.boot.admin.discovery.services property to specifically whitelist applications that you would like to monitor, or, you can use spring.boot.admin.discovery.ignored-services property to blacklist any application you don't want to monitor.

    In your case, you can do:

    spring.boot.admin.discovery.ignored-services:
      - 'admin-server'
    

    where admin-server is spring.application.name of your admin server.

    Checkout Table 4. Discovery configuration options.