From 38622bf7909f91e74a07828d635a7caca828ee7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20Ko=CC=88ninger?= Date: Thu, 5 Oct 2023 09:14:10 +0200 Subject: [PATCH] feat(#1510): add documentation --- .../src/site/asciidoc/_server-discovery.adoc | 24 +++++++++++++++---- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/spring-boot-admin-docs/src/site/asciidoc/_server-discovery.adoc b/spring-boot-admin-docs/src/site/asciidoc/_server-discovery.adoc index 0487bf60bbc..4bffc4c5ba3 100644 --- a/spring-boot-admin-docs/src/site/asciidoc/_server-discovery.adoc +++ b/spring-boot-admin-docs/src/site/asciidoc/_server-discovery.adoc @@ -1,12 +1,15 @@ [[spring-cloud-discovery-support]] == Spring Cloud Discovery == -The Spring Boot Admin Server can use Spring Clouds `DiscoveryClient` to discover applications. The advantage is that the clients don't have to include the `spring-boot-admin-starter-client`. You just have to add a `DiscoveryClient` implementation to your admin server - everything else is done by AutoConfiguration. +The Spring Boot Admin Server can use Spring Clouds `DiscoveryClient` to discover applications. +The advantage is that the clients don't have to include the `spring-boot-admin-starter-client`. +You just have to add a `DiscoveryClient` implementation to your admin server - everything else is done by AutoConfiguration. [[spring-cloud-discovery-static-config]] === Static Configuration using SimpleDiscoveryClient === -Spring Cloud provides a `SimpleDiscoveryClient`. It allows you to specify client applications via static configuration: +Spring Cloud provides a `SimpleDiscoveryClient`. +It allows you to specify client applications via static configuration: [source,xml] .pom.xml @@ -36,14 +39,20 @@ spring: ---- === Other DiscoveryClients === -Spring Boot Admin supports all other implementations of Spring Cloud's `DiscoveryClient` (https://docs.spring.io/spring-cloud-netflix/docs/current/reference/html/#service-discovery-eureka-clients/[Eureka], https://docs.spring.io/spring-cloud-zookeeper/docs/current/reference/html/#spring-cloud-zookeeper-discovery[Zookeeper], https://docs.spring.io/spring-cloud-consul/docs/current/reference/html/#spring-cloud-consul-discovery[Consul], https://docs.spring.io/spring-cloud-kubernetes/docs/current/reference/html/#discoveryclient-for-kubernetes[Kubernetes], ...). You need to add it to the Spring Boot Admin Server and configure it properly. + +Spring Boot Admin supports all other implementations of Spring Cloud's `DiscoveryClient` (https://docs.spring.io/spring-cloud-netflix/docs/current/reference/html/#service-discovery-eureka-clients/[Eureka], https://docs.spring.io/spring-cloud-zookeeper/docs/current/reference/html/#spring-cloud-zookeeper-discovery[Zookeeper], https://docs.spring.io/spring-cloud-consul/docs/current/reference/html/#spring-cloud-consul-discovery[Consul], https://docs.spring.io/spring-cloud-kubernetes/docs/current/reference/html/#discoveryclient-for-kubernetes[Kubernetes], ...). +You need to add it to the Spring Boot Admin Server and configure it properly. An <> is shown above. === Converting ServiceInstances === -The information from the service registry are converted by the `ServiceInstanceConverter`. Spring Boot Admin ships with a default and Eureka converter implementation. The correct one is selected by AutoConfiguration. +The information from the service registry are converted by the `ServiceInstanceConverter`. +Spring Boot Admin ships with a default and Eureka converter implementation. +The correct one is selected by AutoConfiguration. -TIP: You can modify how the information from the registry is used to register the application by using SBA Server configuration options and instance metadata. The values from the metadata takes precedence over the server config. If the plenty of options don't fit your needs you can provide your own `ServiceInstanceConverter`. +TIP: You can modify how the information from the registry is used to register the application by using SBA Server configuration options and instance metadata. +The values from the metadata takes precedence over the server config. +If the plenty of options don't fit your needs you can provide your own `ServiceInstanceConverter`. NOTE: When using Eureka, the `healthCheckUrl` known to Eureka is used for health-checking, which can be set on your client using `eureka.instance.healthCheckUrl`. @@ -75,6 +84,10 @@ user.password | health.path | The path is appended to the service URL and will be used for the health-checking. Ignored by the `EurekaServiceInstanceConverter`. | `${spring.boot.admin.discovery.converter.health-endpoint}` + +| group +| The group is used to group services in the UI by the group name instead of application name. +| |=== .Discovery configuration options @@ -111,6 +124,7 @@ user.password |=== === CloudFoundry === + If you are deploying your applications to CloudFoundry then `vcap.application.application_id` and `vcap.application.instance_index` *_must_* be added to the metadata for proper registration of applications with Spring Boot Admin Server. Here is a sample configuration for Eureka: