<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>build-info</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
Client Applications
Show Version in Application List
For Spring Boot applications the easiest way to show the version, is to use the build-info
goal from the spring-boot-maven-plugin
, which generates the META-INF/build-info.properties
. See also the Spring Boot Reference Guide.
For non-Spring Boot applications you can either add a version
or build.version
to the registration metadata and the version will show up in the application list.
To generate the build-info in a gradle project, add the following snippet to your build.gradle
:
springBoot {
buildInfo()
}
JMX-Bean Management
To interact with JMX-beans in the admin UI you have to include Jolokia in your application and expose it via the actuator endpoint. As Jolokia is servlet based there is no support for reactive applications.
You might want to set spring.jmx.enabled=true
if you want to expose Spring beans via JMX.
Spring Boot 3 App
Spring Boot 3 does not support Jolokia directly, you need a separate dependency for Spring Boot 3 based applications. See https://jolokia.org/reference/html/manual/spring.html for more details.
<dependency>
<groupId>org.jolokia</groupId>
<artifactId>jolokia-support-spring</artifactId>
<version>2.1.0</version>
</dependency>
Spring Boot 2 App
You can still monitor Spring Boot 2 applications with Jolokia endpoint using a Spring Boot Admin 3 server. Spring Boot 2 provided the actuator itself, so you only the need the plain jolokia dependency.
<dependency>
<groupId>org.jolokia</groupId>
<artifactId>jolokia-core</artifactId>
</dependency>
Logfile Viewer
By default the logfile is not accessible via actuator endpoints and therefore not visible in Spring Boot Admin. In order to enable the logfile actuator endpoint you need to configure Spring Boot to write a logfile, either by setting logging.file.path
or logging.file.name
.
Spring Boot Admin will detect everything that looks like an URL and render it as hyperlink.
ANSI color-escapes are also supported. You need to set a custom file log pattern as Spring Boot’s default one doesn’t use colors.
To enforce the use of ANSI-colored output, set spring.output.ansi.enabled=ALWAYS
. Otherwise Spring tries to detect if ANSI-colored output is available and might disable it.
logging.file.name=/var/log/sample-boot-application.log (1) logging.pattern.file=%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(%5p) %clr(${PID}){magenta} %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n%wEx (2)
1 | Destination the logfile is written to. Enables the logfile actuator endpoint. |
2 | File log pattern using ANSI colors. |
Show Tags per Instance
Tags
are a way to add visual markers per instance, they will appear in the application list as well as in the instance view. By default no tags are added to instances, and it’s up to the client to specify the desired tags by adding the information to the metadata or info endpoint.
#using the metadata spring.boot.admin.client.instance.metadata.tags.environment=test #using the info endpoint info.tags.environment=test
Spring Boot Admin Client
The Spring Boot Admin Client registers the application at the admin server. This is done by periodically doing a HTTP post request to the SBA Server providing information about the application.
There are plenty of properties to influence the way how the SBA Client registers your application. In case that doesn’t fit your needs, you can provide your own ApplicationFactory implementation. |
Property name | Description | Default value |
---|---|---|
spring.boot.admin.client.enabled |
Enables the Spring Boot Admin Client. |
|
spring.boot.admin.client.url |
Comma separated ordered list of URLs of the Spring Boot Admin server to register at. This triggers the AutoConfiguration. Mandatory. |
|
spring.boot.admin.client.api-path |
Http-path of registration endpoint at your admin server. |
|
spring.boot.admin.client.username |
Username and password in case the SBA Server api is protected with HTTP Basic authentication. |
|
spring.boot.admin.client.period |
Interval for repeating the registration (in ms). |
|
spring.boot.admin.client.connect-timeout |
Connect timeout for the registration (in ms). |
|
spring.boot.admin.client.read-timeout |
Read timeout for the registration (in ms). |
|
spring.boot.admin.client.auto-registration |
If set to true the periodic task to register the application is automatically scheduled after the application is ready. |
|
spring.boot.admin.client.auto-deregistration |
Switch to enable auto-deregistration at Spring Boot Admin server when context is closed. If the value is unset the feature is active if a running CloudPlatform was detected. |
|
spring.boot.admin.client.register-once |
If set to true the client will only register against one admin server (in order defined by |
|
spring.boot.admin.client.instance.health-url |
Health-url to register with. Can be overridden in case the reachable URL is different (e.g. Docker). Must be unique in registry. |
Guessed based on management-base-url and |
spring.boot.admin.client.instance.management-base-url |
Base url for computing the management-url to register with. The path is inferred at runtime, and appended to the base url. |
Guessed based on |
spring.boot.admin.client.instance.management-url |
Management-url to register with. Can be overridden in case the reachable url is different (e.g. Docker). |
Guessed based on management-base-url and |
spring.boot.admin.client.instance.service-base-url |
Base url for computing the service-url to register with. The path is inferred at runtime, and appended to the base url. In Cloudfoundry environments you can switching to https like this: |
Guessed based on hostname, |
spring.boot.admin.client.instance.service-url |
Service-url to register with. Can be overridden in case the reachable url is different (e.g. Docker). |
Guessed based on service-base-url and |
spring.boot.admin.client.instance.service-path |
Service-path to register with. Can be overridden in case the reachable path is different (e.g. context-path set programmatically). |
/ |
spring.boot.admin.client.instance.name |
Name to register with. |
|
spring.boot.admin.client.instance.service-host-type |
Select which information should be considered when sending the host of a service: |
|
spring.boot.admin.client.instance.metadata.* |
Metadata key-value-pairs to be associated with this instance. |
|
spring.boot.admin.client.instance.metadata.tags.* |
Tags as key-value-pairs to be associated with this instance. |
Key | Value | Default value |
---|---|---|
user.name |
Credentials being used to access the endpoints. |