Monitor your Spring Boot Applications with ease. An open source monitoring tool build by developers for developers.
-diff --git a/current/_index.html b/current/_index.html deleted file mode 100644 index ec298421716..00000000000 --- a/current/_index.html +++ /dev/null @@ -1,129 +0,0 @@ - - - - -
- - - - -Spring Boot Admin Server supports cluster replication via Hazelcast. It is automatically enabled when a HazelcastConfig
- or HazelcastInstance
-Bean is present. You can also configure the Hazelcast instance to be persistent, to keep the status over restarts. Also have a look at the Spring Boot support for Hazelcast.
Add Hazelcast to your dependencies:
-<dependency>
- <groupId>com.hazelcast</groupId>
- <artifactId>hazelcast</artifactId>
-</dependency>
- Instantiate a HazelcastConfig:
-@Bean
-public Config hazelcastConfig() {
- // This map is used to store the events.
- // It should be configured to reliably hold all the data,
- // Spring Boot Admin will compact the events, if there are too many
- MapConfig eventStoreMap = new MapConfig(DEFAULT_NAME_EVENT_STORE_MAP).setInMemoryFormat(InMemoryFormat.OBJECT)
- .setBackupCount(1)
- .setMergePolicyConfig(new MergePolicyConfig(PutIfAbsentMergePolicy.class.getName(), 100));
-
- // This map is used to deduplicate the notifications.
- // If data in this map gets lost it should not be a big issue as it will atmost
- // lead to
- // the same notification to be sent by multiple instances
- MapConfig sentNotificationsMap = new MapConfig(DEFAULT_NAME_SENT_NOTIFICATIONS_MAP)
- .setInMemoryFormat(InMemoryFormat.OBJECT)
- .setBackupCount(1)
- .setEvictionConfig(
- new EvictionConfig().setEvictionPolicy(EvictionPolicy.LRU).setMaxSizePolicy(MaxSizePolicy.PER_NODE))
- .setMergePolicyConfig(new MergePolicyConfig(PutIfAbsentMergePolicy.class.getName(), 100));
-
- Config config = new Config();
- config.addMapConfig(eventStoreMap);
- config.addMapConfig(sentNotificationsMap);
- config.setProperty("hazelcast.jmx", "true");
-
- // WARNING: This setups a local cluster, you change it to fit your needs.
- config.getNetworkConfig().getJoin().getMulticastConfig().setEnabled(false);
- TcpIpConfig tcpIpConfig = config.getNetworkConfig().getJoin().getTcpIpConfig();
- tcpIpConfig.setEnabled(true);
- tcpIpConfig.setMembers(singletonList("127.0.0.1"));
- return config;
-}
- Property name | -Description | -Default value | -
---|---|---|
spring.boot.admin.hazelcast.enabled |
- Enables the Hazelcast support |
-
|
-
spring.boot.admin.hazelcast.event-store |
- Name of the Hazelcast-map to store the events |
-
|
-
spring.boot.admin.hazelcast.sent-notifications |
- Name of the Hazelcast-map used to deduplicate the notifications. |
-
|
-
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 provides a SimpleDiscoveryClient
. It allows you to specify client applications via static configuration:
<dependency>
- <groupId>org.springframework.cloud</groupId>
- <artifactId>spring-cloud-starter</artifactId>
-</dependency>
- spring:
- cloud:
- discovery:
- client:
- simple:
- instances:
- test:
- - uri: http://instance1.intern:8080
- metadata:
- management.context-path: /actuator
- - uri: http://instance2.intern:8080
- metadata:
- management.context-path: /actuator
- Spring Boot Admin supports all other implementations of Spring Cloud’s DiscoveryClient
(Eureka, Zookeeper, Consul, Kubernetes, …). You need to add it to the Spring Boot Admin Server and configure it properly. An example setup using Eureka is shown above.
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.
- | 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 . |
-
- | When using Eureka, the healthCheckUrl known to Eureka is used for health-checking, which can be set on your client using eureka.instance.healthCheckUrl . |
-
Key | -Value | -Default value | -
---|---|---|
user.name |
- Credentials being used to access the endpoints. |
- - |
management.scheme |
- The scheme is substituted in the service URL and will be used for accessing the actuator endpoints. |
- - |
management.address |
- The address is substituted in the service URL and will be used for accessing the actuator endpoints. |
- - |
management.port |
- The port is substituted in the service URL and will be used for accessing the actuator endpoints. |
- - |
management.context-path |
- The path is appended to the service URL and will be used for accessing the actuator endpoints. |
-
|
-
health.path |
- The path is appended to the service URL and will be used for the health-checking. Ignored by the |
-
|
-
group |
- The group is used to group services in the UI by the group name instead of application name. |
- - |
Property name | -Description | -Default value | -
---|---|---|
spring.boot.admin.discovery.enabled |
- Enables the DiscoveryClient-support for the admin server. |
-
|
-
spring.boot.admin.discovery.converter.management-context-path |
- Will be appended to the service-url of the discovered service when the management-url is converted by the |
-
|
-
spring.boot.admin.discovery.converter.health-endpoint-path |
- Will be appended to the management-url of the discovered service when the health-url is converted by the |
-
|
-
spring.boot.admin.discovery.ignored-services |
- This services will be ignored when using discovery and not registered as application. Supports simple patterns (e.g. "foo*", "*bar", "foo*bar*"). |
- - |
spring.boot.admin.discovery.services |
- This services will be included when using discovery and registered as application. Supports simple patterns (e.g. "foo*", "*bar", "foo*bar*"). |
-
|
-
spring.boot.admin.discovery.ignored-instances-metadata |
- Instances of services will be ignored if they contain at least one metadata item that matches this list. (e.g. "discoverable=false") |
- - |
spring.boot.admin.discovery.instances-metadata |
- Instances of services will be included if they contain at least one metadata item that matches this list. (e.g. "discoverable=true") |
- - |
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:
eureka:
- instance:
- hostname: ${vcap.application.uris[0]}
- nonSecurePort: 80
- metadata-map:
- applicationId: ${vcap.application.application_id}
- instanceId: ${vcap.application.instance_index}
- 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.
<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>
- To generate the build-info in a gradle project, add the following snippet to your build.gradle
:
springBoot {
- buildInfo()
-}
- 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 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>
- 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>
- 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. | -
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-
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. |
- - |
In case you need to inject custom HTTP headers into the requests made to the monitored application’s actuator endpoints you can easily add a HttpHeadersProvider
:
@Bean
-public HttpHeadersProvider customHttpHeadersProvider() {
- return (instance) -> {
- HttpHeaders httpHeaders = new HttpHeaders();
- httpHeaders.add("X-CUSTOM", "My Custom Value");
- return httpHeaders;
- };
-}
- You can intercept and modify requests and responses made to the monitored application’s actuator endpoints by implementing the InstanceExchangeFilterFunction
interface. This can be useful for auditing or adding some extra security checks.
@Bean
-public InstanceExchangeFilterFunction auditLog() {
- return (instance, request, next) -> next.exchange(request).doOnSubscribe((s) -> {
- if (HttpMethod.DELETE.equals(request.method()) || HttpMethod.POST.equals(request.method())) {
- log.info("{} for {} on {}", request.method(), instance.getId(), request.url());
- }
- });
-}
- You can add your own Notifiers by adding Spring Beans which implement the Notifier
interface, at best by extending AbstractEventNotifier
or AbstractStatusChangeNotifier
.
public class CustomNotifier extends AbstractEventNotifier {
-
- private static final Logger LOGGER = LoggerFactory.getLogger(LoggingNotifier.class);
-
- public CustomNotifier(InstanceRepository repository) {
- super(repository);
- }
-
- @Override
- protected Mono<Void> doNotify(InstanceEvent event, Instance instance) {
- return Mono.fromRunnable(() -> {
- if (event instanceof InstanceStatusChangedEvent) {
- LOGGER.info("Instance {} ({}) is {}", instance.getRegistration().getName(), event.getInstance(),
- ((InstanceStatusChangedEvent) event).getStatusInfo().getStatus());
- }
- else {
- LOGGER.info("Instance {} ({}) {}", instance.getRegistration().getName(), event.getInstance(),
- event.getType());
- }
- });
- }
-
-}
- Links will be opened in a new window/tab (i.e. target="_blank"
) having no access to opener and referrer (rel="noopener noreferrer"
).
To add a simple link to an external page, use the following snippet.
-spring:
- boot:
- admin:
- ui:
- external-views:
- - label: "🚀" (1)
- url: "https://codecentric.de" (2)
- order: 2000 (3)
- 1 | -The label will be shown in the navbar | -
2 | -URL to the page you want to link to | -
3 | -Order that allows to specify position of item in navbar | -
To aggregate links below a single element, dropdowns can be configured as follows.
-spring:
- boot:
- admin:
- ui:
- external-views:
- - label: Link w/o children
- children:
- - label: "📖 Docs"
- url: https://codecentric.github.io/spring-boot-admin/current/
- - label: "📦 Maven"
- url: https://search.maven.org/search?q=g:de.codecentric%20AND%20a:spring-boot-admin-starter-server
- - label: "🐙 GitHub"
- url: https://github.com/codecentric/spring-boot-admin
- spring:
- boot:
- admin:
- ui:
- external-views:
- - label: Link w children
- url: https://codecentric.de (1)
- children:
- - label: "📖 Docs"
- url: https://codecentric.github.io/spring-boot-admin/current/
- - label: "📦 Maven"
- url: https://search.maven.org/search?q=g:de.codecentric%20AND%20a:spring-boot-admin-starter-server
- - label: "🐙 GitHub"
- url: https://github.com/codecentric/spring-boot-admin
- - label: "🎅 Is it christmas"
- url: https://isitchristmas.com
- iframe: true
- It is possible to add custom views to the ui. The views must be implemented as Vue.js components.
-The JavaScript-Bundle and CSS-Stylesheet must be placed on the classpath at /META-INF/spring-boot-admin-server-ui/extensions/{name}/
so the server can pick them up. The spring-boot-admin-sample-custom-ui module contains a sample which has the necessary maven setup to build such a module.
The custom extension registers itself by calling:
-SBA.use({
- install({ viewRegistry, i18n }) {
- viewRegistry.addView({
- name: "custom", (1)
- path: "/custom", (2)
- component: custom, (3)
- group: "custom", (4)
- handle, (5)
- order: 1000, (6)
- });
- i18n.mergeLocaleMessage("en", {
- custom: {
- label: "My Extensions", (7)
- },
- });
- i18n.mergeLocaleMessage("de", {
- custom: {
- label: "Meine Erweiterung",
- },
- });
- },
-});
- 1 | -Name of the view and the route. | -
2 | -Path in Vue router. | -
3 | -The imported custom component, which will be rendered on the route. | -
4 | -An optional group name that allows to bind views to a logical group (defaults to "none") | -
5 | -The handle for the custom view to be shown in the top navigation bar. | -
6 | -Order for the view. | -
7 | -Using i18n.mergeLocaleMessage allows to add custom translations. |
-
Views in the top navigation bar are sorted by ascending order.
-If new top level routes are added to the frontend, they also must be known to the backend. Add a /META-INF/spring-boot-admin-server-ui/extensions/{name}/routes.txt
with all your new toplevel routes (one route per line).
Groups are used in instance sidebar to aggregate multiple views into a collapsible menu entry showing the group’s name. When a group contains just a single element, the label of the view is shown instead of the group’s name.
-In order to override or set icons for (custom) groups you can use the SBA.viewRegistry.setGroupIcon
function as follows:
SBA.viewRegistry.setGroupIcon(
- "custom", (1)
- `<svg xmlns='http://www.w3.org/2000/svg'
- class='h-5 mr-3'
- viewBox='0 0 576 512'><path d='M512 80c8.8 0 16 7.2 16 16V416c0 8.8-7.2 16-16 16H64c-8.8 0-16-7.2-16-16V96c0-8.8 7.2-16 16-16H512zM64 32C28.7 32 0 60.7 0 96V416c0 35.3 28.7 64 64 64H512c35.3 0 64-28.7 64-64V96c0-35.3-28.7-64-64-64H64zM200 208c14.2 0 27 6.1 35.8 16c8.8 9.9 24 10.7 33.9 1.9s10.7-24 1.9-33.9c-17.5-19.6-43.1-32-71.5-32c-53 0-96 43-96 96s43 96 96 96c28.4 0 54-12.4 71.5-32c8.8-9.9 8-25-1.9-33.9s-25-8-33.9 1.9c-8.8 9.9-21.6 16-35.8 16c-26.5 0-48-21.5-48-48s21.5-48 48-48zm144 48c0-26.5 21.5-48 48-48c14.2 0 27 6.1 35.8 16c8.8 9.9 24 10.7 33.9 1.9s10.7-24 1.9-33.9c-17.5-19.6-43.1-32-71.5-32c-53 0-96 43-96 96s43 96 96 96c28.4 0 54-12.4 71.5-32c8.8-9.9 8-25-1.9-33.9s-25-8-33.9 1.9c-8.8 9.9-21.6 16-35.8 16c-26.5 0-48-21.5-48-48z'/>
- </svg>` (2)
-);
- 1 | -Name of the group to set icon for | -
2 | -Arbitrary HTML code (e.g. SVG image) that is inserted and parsed as icon. | -
Here is a simple top level view just listing all registered applications:
-<template>
- <div class="m-4">
- <template v-for="application in applications" :key="application.name">
- <sba-panel :title="application.name">
- This application has the following instances:
-
- <ul>
- <template v-for="instance in application.instances">
- <li>
- <span class="mx-1" v-text="instance.registration.name"></span>
-
- <!-- SBA components are registered globally and can be used without importing them! -->
- <!-- They are defined in spring-boot-admin-server-ui -->
- <sba-status :status="instance.statusInfo.status" class="mx-1" />
- <sba-tag :value="instance.id" class="mx-1" label="id" />
- </li>
- </template>
- </ul>
- </sba-panel>
- </template>
- <pre v-text="applications"></pre>
- </div>
-</template>
-
-<script>
-/* global SBA */
-import "./custom.css";
-
-export default {
- setup() {
- const { applications } = SBA.useApplicationStore(); (1)
- return {
- applications,
- };
- },
- methods: {
- stringify: JSON.stringify,
- },
-};
-</script>
- 1 | -By destructuring applications of SBA.useApplicationStore() , you have reactive access to registered applications. |
-
- | There are some helpful methods on the application and instances object available. Have a look at application.ts and instance.ts | -
And this is how you register the top-level view.
-SBA.viewRegistry.addView({
- name: "customSub",
- parent: "custom", (1)
- path: "/customSub", (2)
- component: customSubitem,
- label: "Custom Sub",
- order: 1000,
-});
- 1 | -References the name of the parent view. | -
2 | -Router path used to navigate to. | -
3 | -Define whether the path should be registered as child route in parent’s route. When set to true , the parent component has to implement <router-view> |
-
The routes.txt
config with the added route:
/custom/**
-/customSub/**
- Here is a view to show a custom endpoint:
-<template>
- <div class="custom">
- <p>Instance: <span v-text="instance.id" /></p>
- <p>Output: <span v-html="text" /></p>
- </div>
-</template>
-
-<script>
-export default {
- props: {
- instance: {
- (1)
- type: Object,
- required: true,
- },
- },
- data: () => ({
- text: "",
- }),
- async created() {
- console.log(this.instance);
- const response = await this.instance.axios.get("actuator/custom"); (2)
- this.text = response.data;
- },
-};
-</script>
-
-<style lang="css" scoped>
-.custom {
- font-size: 20px;
- width: 80%;
-}
-</style>
- 1 | -If you define a instance prop the component will receive the instance the view should be rendered for. |
-
2 | -Each instance has a preconfigured axios instance to access the endpoints with the correct path and headers. | -
Registering the instance view works like for the top-level view with some additional properties:
-SBA.viewRegistry.addView({
- name: "instances/custom",
- parent: "instances", (1)
- path: "custom",
- component: customEndpoint,
- label: "Custom",
- group: "custom", (2)
- order: 1000,
- isEnabled: ({ instance }) => {
- return instance.hasEndpoint("custom");
- }, (3)
-});
- 1 | -The parent must be 'instances' in order to render the new custom view for a single instance. | -
2 | -You can group views by assigning them to a group. | -
3 | -If you add a isEnabled callback you can figure out dynamically if the view should be show for the particular instance. |
-
- | You can override default views by putting the same group and name as the one you want to override. | -
You can set custom information in the header (i.e. displaying staging information or company name) by using following configuration properties:
-spring.boot.admin.ui.brand: This HTML snippet is rendered in navigation header and defaults to <img src="assets/img/icon-spring-boot-admin.svg"><span>Spring Boot Admin</span>
. By default it shows the SBA logo followed by it’s name. If you want to show a custom logo you can set: spring.boot.admin.ui.brand=<img src="custom/custom-icon.png">
. Either you just add the image to your jar-file in /META-INF/spring-boot-admin-server-ui/
(SBA registers a ResourceHandler
for this location by default), or you must ensure yourself that the image gets served correctly (e.g. by registering your own ResourceHandler
)
spring.boot.admin.ui.title: Use this option to customize the browsers window title.
You can provide a custom color theme to the application by overwriting the following properties:
-spring:
- boot:
- admin:
- ui:
- theme:
- color: "#4A1420"
- palette:
- 50: "#F8EBE4"
- 100: "#F2D7CC"
- 200: "#E5AC9C"
- 300: "#D87B6C"
- 400: "#CB463B"
- 500: "#9F2A2A"
- 600: "#83232A"
- 700: "#661B26"
- 800: "#4A1420"
- 900: "#2E0C16"
- Property name | -Default | -Usage | -
---|---|---|
|
-
|
- Used in |
-
|
-
|
- Disable background image in UI |
-
|
-
|
- Define a color palette that affects the colors in sidebar view (e.g shade |
-
You can set a custom image to be displayed on the login page.
-Put the image in a resource location which is served via http (e.g. /META-INF/spring-boot-admin-server-ui/assets/img/
).
Configure the icons to use using the following property:
-spring.boot.admin.ui.login-icon: Used as icon on login page. (e.g assets/img/custom-login-icon.svg
)
It is possible to use a custom favicon, which is also used for desktop notifications. Spring Boot Admin uses a different icon when one or more application is down.
-Put the favicon (.png
with at least 192x192 pixels) in a resource location which is served via http (e.g. /META-INF/spring-boot-admin-server-ui/assets/img/
).
Configure the icons to use using the following properties:
-spring.boot.admin.ui.favicon
: Used as default icon. (e.g assets/img/custom-favicon.png
spring.boot.admin.ui.favicon-danger
: Used when one or more service is down. (e.g assets/img/custom-favicon-danger.png
)
To filter languages to a subset of all supported languages:
-spring.boot.admin.ui.available-languages: Used as a filter of existing languages. (e.g en,de
out of existing de,en,fr,ko,pt-BR,ru,zh
)
You can very simply hide views in the navbar:
-spring:
- boot:
- admin:
- ui:
- view-settings:
- - name: "journal"
- enabled: false
- To hide service URLs in Spring Boot Admin UI entirely, set the following property in your Server’s configuration:
-Property name | -Default | -Usage | -
---|---|---|
|
-
|
- Set to |
-
If you want to hide the URL for specific instances oncly, you can set the hide-url
property in the instance metadata while registering a service. When using Spring Boot Admin Client you can set the property spring.boot.admin.client.metadata.hide-url=true
in the corresponding config file. The value set in metadata
does not have any effect, when the URLs are disabled in Server.
tl;dr You can, but you shouldn’t.
You can set spring.boot.admin.context-path
to alter the path where the UI and REST-API is served, but depending on the complexity of your application you might get in trouble. On the other hand in my opinion it makes no sense for an application to monitor itself. In case your application goes down your monitoring tool also does.
Yes, you can refresh the entire environment or set/update individual properties for both single instances as well as for the entire application. Note, however, that the Spring Boot application needs to have Spring Cloud Commons and management.endpoint.env.post.enabled=true
in place. Also check the details of @RefreshScope
https://docs.spring.io/spring-cloud-commons/docs/current/reference/html/#refresh-scope.
Spring Boot Admin is a monitoring tool that aims to visualize information provided by Spring Boot Actuators in a nice and accessible way. It consists of two major parts:
-A server that provides a user interface to display and interact with Spring Boot Actuators.
A client that is used to register at the server and allow to access actuator endpoints.
Since Spring Boot Admin relies on Spring Boot, you have to set up a Spring Boot application first. We recommend doing this by using http://start.spring.io. Spring Boot Admin Server is capable of running as servlet or webflux application, you need to decide on this and add the according Spring Boot Starter. In this example we’re using the servlet web starter.
-Add Spring Boot Admin Server starter to your dependencies:
-<dependency>
- <groupId>de.codecentric</groupId>
- <artifactId>spring-boot-admin-starter-server</artifactId>
- <version>3.4.1</version>
-</dependency>
-<dependency>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter-web</artifactId>
-</dependency>
- Pull in the Spring Boot Admin Server configuration via adding @EnableAdminServer
to your configuration:
@SpringBootApplication
-@EnableAdminServer
-public class SpringBootAdminApplication {
- public static void main(String[] args) {
- SpringApplication.run(SpringBootAdminApplication.class, args);
- }
-}
- - | If you want to setup the Spring Boot Admin Server via war-deployment in a servlet-container, please have a look at the spring-boot-admin-sample-war. | -
- | See also the spring-boot-admin-sample-servlet project, which also adds security. | -
To register your application at the SBA Server, you can either include the SBA Client or use Spring Cloud Discovery (e.g. Eureka, Consul, …). There is also a simple option using a static configuration on the SBA Server side.
-Each application that wants to register has to include the Spring Boot Admin Client. In order to secure the endpoints, also add the spring-boot-starter-security
.
Add spring-boot-admin-starter-client to your dependencies:
-<dependency>
- <groupId>de.codecentric</groupId>
- <artifactId>spring-boot-admin-starter-client</artifactId>
- <version>3.4.1</version>
-</dependency>
-<dependency>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter-security</artifactId>
-</dependency>
- Enable the SBA Client by configuring the URL of the Spring Boot Admin Server:
-spring.boot.admin.client.url=http://localhost:8080 (1)
-management.endpoints.web.exposure.include=* (2)
-management.info.env.enabled=true (3)
- 1 | -The URL of the Spring Boot Admin Server to register at. | -
2 | -As with Spring Boot 2 most of the endpoints aren’t exposed via http by default, we expose all of them. For production you should carefully choose which endpoints to expose. | -
3 | -Since Spring Boot 2.6, env info contributor is disabled by default. Hence, we have to enable it. | -
Make the actuator endpoints accessible:
-@Configuration
-public static class SecurityPermitAllConfig {
- @Bean
- protected SecurityFilterChain filterChain(HttpSecurity http) {
- return http.authorizeHttpRequests((authorizeRequests) -> authorizeRequests.anyRequest().permitAll())
- .csrf().disable().build();
- }
-}
- 1 | -For the sake of brevity we’re disabling the security for now. Have a look at the security section on how to deal with secured endpoints. | -
If you already use Spring Cloud Discovery for your applications you don’t need the SBA Client. Just add a DiscoveryClient to Spring Boot Admin Server, the rest is done by our AutoConfiguration.
-The following steps uses Eureka, but other Spring Cloud Discovery implementations are supported as well. There are examples using Consul and Zookeeper.
-Also, have a look at the Spring Cloud documentation.
-Add spring-cloud-starter-eureka to your dependencies:
-<dependency>
- <groupId>org.springframework.cloud</groupId>
- <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
-</dependency>
- Enable discovery by adding @EnableDiscoveryClient
to your configuration:
@Configuration
-@EnableAutoConfiguration
-@EnableDiscoveryClient
-@EnableScheduling
-@EnableAdminServer
-public class SpringBootAdminApplication {
- public static void main(String[] args) {
- SpringApplication.run(SpringBootAdminApplication.class, args);
- }
-}
- Tell the Eureka client where to find the service registry:
-eureka: (1)
- instance:
- leaseRenewalIntervalInSeconds: 10
- health-check-url-path: /actuator/health
- metadata-map:
- startup: ${random.int} #needed to trigger info and endpoint update after restart
- client:
- registryFetchIntervalSeconds: 5
- serviceUrl:
- defaultZone: ${EUREKA_SERVICE_URL:http://localhost:8761}/eureka/
-
-management:
- endpoints:
- web:
- exposure:
- include: "*" (2)
- endpoint:
- health:
- show-details: ALWAYS
- 1 | -Configuration section for the Eureka client | -
2 | -As with Spring Boot 2 most of the endpoints aren’t exposed via http by default, we expose all of them. For production you should carefully choose which endpoints to expose. | -
See also spring-boot-admin-sample-eureka.
-- | You can include the Spring Boot Admin Server to your Eureka server. Setup everything as described above and set spring.boot.admin.context-path to something different than "/" so that the Spring Boot Admin Server UI won’t clash with Eureka’s one. |
-
If you want to use a snapshot version of Spring Boot Admin Server you most likely need to include the spring and sonatype snapshot repositories:
-<repositories>
- <repository>
- <id>spring-milestone</id>
- <snapshots>
- <enabled>false</enabled>
- </snapshots>
- <url>http://repo.spring.io/milestone</url>
- </repository>
- <repository>
- <id>spring-snapshot</id>
- <snapshots>
- <enabled>true</enabled>
- </snapshots>
- <url>http://repo.spring.io/snapshot</url>
- </repository>
- <repository>
- <id>sonatype-nexus-snapshots</id>
- <name>Sonatype Nexus Snapshots</name>
- <url>https://oss.sonatype.org/content/repositories/snapshots/</url>
- <snapshots>
- <enabled>true</enabled>
- </snapshots>
- <releases>
- <enabled>false</enabled>
- </releases>
- </repository>
-</repositories>
- Hauptsitz der Gesellschaft
codecentric AG
Hochstraße 11
42697 Solingen
Telefon: +49 (0) 212 23 36 28 0
Telefax: +49 (0) 212.23 36 28 79
E-Mail: info@codecentric.de
Vorstand
Rainer Vehns (Vorsitzender)
Verena Deller
Stefan Riedel
Lars Rückemann
Handelsregister
Amtsgericht Wuppertal, HRB 25917
Umsatzsteueridentifikationsnummer
DE 119437798
Inhaltlich Verantwortlicher
Inhaltlich Verantwortlicher gemäß § 18 Abs. 2 MStV: Rainer Vehns
Die Verantwortliche im Sinne der Datenschutz-Grundverordnung und anderer nationaler Datenschutzgesetze der Mitgliedsstaaten sowie sonstiger datenschutzrechtlicher Bestimmungen ist die:
-codecentric AG
Hochstraße 11
42697 Solingen
Deutschland
Tel.: +49 [0] 212 23 36 28 0
E-Mail: office@codecentric.de
Website: www.codecentric.de
Der Datenschutzbeauftragte der Verantwortlichen ist wie folgt zu erreichen:
-codecentric AG
Hochstraße 11
42697 Solingen
Deutschland
E-Mail: datenschutz@codecentric.de
Wir verarbeiten personenbezogene Daten unserer Nutzer grundsätzlich nur, soweit dies zur Bereitstellung einer funktionsfähigen Website sowie unserer Inhalte und Leistungen erforderlich ist. Die Verarbeitung personenbezogener Daten unserer Nutzer erfolgt regelmäßig nur nach Einwilligung des Nutzers. Eine Ausnahme gilt in solchen Fällen, in denen eine vorherige Einholung einer Einwilligung aus tatsächlichen Gründen nicht möglich ist und die Verarbeitung der Daten durch gesetzliche Vorschriften gestattet ist.
-Soweit wir für Verarbeitungsvorgänge personenbezogener Daten eine Einwilligung der betroffenen Person einholen, dient Art. 6 Abs. 1 lit. a EU-Datenschutzgrundverordnung (DSGVO) als Rechtsgrundlage.
-Bei der Verarbeitung von personenbezogenen Daten, die zur Erfüllung eines Vertrages, dessen Vertragspartei die betroffene Person ist, erforderlich ist, dient Art. 6 Abs. 1 lit. b DSGVO als Rechtsgrundlage. Dies gilt auch für Verarbeitungsvorgänge, die zur Durchführung vorvertraglicher Maßnahmen erforderlich sind.
-Soweit eine Verarbeitung personenbezogener Daten zur Erfüllung einer rechtlichen Verpflichtung erforderlich ist, der unser Unternehmen unterliegt, dient Art. 6 Abs. 1 lit. c DSGVO als Rechtsgrundlage.
-Für den Fall, dass lebenswichtige Interessen der betroffenen Person oder einer anderen natürlichen Person eine Verarbeitung personenbezogener Daten erforderlich machen, dient Art. 6 Abs. 1 lit. d DSGVO als Rechtsgrundlage.
-Ist die Verarbeitung zur Wahrung eines berechtigten Interesses unseres Unternehmens oder eines Dritten erforderlich und überwiegen die Interessen, Grundrechte und Grundfreiheiten des Betroffenen das erstgenannte Interesse nicht, so dient Art. 6 Abs. 1 lit. f DSGVO als Rechtsgrundlage für die Verarbeitung.
-Die personenbezogenen Daten der betroffenen Person werden gelöscht oder gesperrt, sobald der Zweck der Speicherung entfällt. Eine Speicherung kann darüber hinaus erfolgen, wenn dies durch den europäischen oder nationalen Gesetzgeber in unionsrechtlichen Verordnungen, Gesetzen oder sonstigen Vorschriften, denen der Verantwortliche unterliegt, vorgesehen wurde. Eine Sperrung oder Löschung der Daten erfolgt auch dann, wenn eine durch die genannten Normen vorgeschriebene Speicherfrist abläuft, es sei denn, dass eine Erforderlichkeit zur weiteren Speicherung der Daten für einen Vertragsabschluss oder eine Vertragserfüllung besteht.
-Bei jedem Aufruf unserer Internetseite erfasst unser System automatisiert Daten und Informationen vom Computersystem des aufrufenden Rechners.
-Folgende Daten werden hierbei erhoben:
-Informationen über den Browsertyp und die verwendete Version
Das Betriebssystem des Nutzers
Den Internet-Service-Provider des Nutzers
Die IP-Adresse des Nutzers
Datum und Uhrzeit des Zugriffs
Websites, von denen das System des Nutzers auf unsere Internetseite gelangt
Websites, die vom System des Nutzers über unsere Website aufgerufen werden
Die Daten werden ebenfalls in den Logfiles unseres Systems gespeichert. Eine Speicherung dieser Daten zusammen mit anderen personenbezogenen Daten des Nutzers findet nicht statt.
-Rechtsgrundlage für die vorübergehende Speicherung der Daten und der Logfiles ist Art. 6 Abs. 1 lit. f DSGVO.
-Die vorübergehende Speicherung der IP-Adresse durch das System ist notwendig, um eine Auslieferung der Website an den Rechner des Nutzers zu ermöglichen. Hierfür muss die IP-Adresse des Nutzers für die Dauer der Sitzung gespeichert bleiben.
-Die Speicherung in Logfiles erfolgt, um die Funktionsfähigkeit der Website sicherzustellen. Zudem dienen uns die Daten zur technischen Optimierung der Website und zur Sicherstellung der Sicherheit unserer informationstechnischen Systeme. Eine Auswertung der Daten zu Marketingzwecken findet in diesem Zusammenhang nicht statt.
-In diesen Zwecken liegt auch unser berechtigtes Interesse an der Datenverarbeitung nach Art. 6 Abs. 1 lit. f DSGVO.
-Die Daten werden gelöscht, sobald sie für die Erreichung des Zweckes ihrer Erhebung nicht mehr erforderlich sind. Im Falle der Erfassung der Daten zur Bereitstellung der Website ist dies der Fall, wenn die jeweilige Sitzung beendet ist.
-Im Falle der Speicherung der Daten in Logfiles ist dies nach spätestens sieben Tagen der Fall. Eine darüberhinausgehende Speicherung ist möglich. In diesem Fall werden die IP-Adressen der Nutzer gelöscht oder verfremdet, sodass eine Zuordnung des aufrufenden Clients nicht mehr möglich ist.
-Die Erfassung der Daten zur Bereitstellung der Website und die Speicherung der Daten in Logfiles ist für den Betrieb der Internetseite zwingend erforderlich. Es besteht folglich seitens des Nutzers keine Widerspruchsmöglichkeit.
-Werden personenbezogene Daten von Ihnen verarbeitet, sind Sie Betroffener i.S.d. DSGVO und es stehen Ihnen folgende Rechte gegenüber dem Verantwortlichen zu:
-Sie können von dem Verantwortlichen eine Bestätigung darüber verlangen, ob personenbezogene Daten, die Sie betreffen, von uns verarbeitet werden.
-Liegt eine solche Verarbeitung vor, können Sie von dem Verantwortlichen über folgende Informationen Auskunft verlangen:
-(1) die Zwecke, zu denen die personenbezogenen Daten verarbeitet werden;
-(2) die Kategorien von personenbezogenen Daten, welche verarbeitet werden;
-(3) die Empfänger bzw. die Kategorien von Empfängern, gegenüber denen die Sie betreffenden personenbezogenen Daten offengelegt wurden oder noch offengelegt werden;
-(4) die geplante Dauer der Speicherung der Sie betreffenden personenbezogenen Daten oder, falls konkrete Angaben hierzu nicht möglich sind, Kriterien für die Festlegung der Speicherdauer;
-(5) das Bestehen eines Rechts auf Berichtigung oder Löschung der Sie betreffenden personenbezogenen Daten, eines Rechts auf Einschränkung der Verarbeitung durch den Verantwortlichen oder eines Widerspruchsrechts gegen diese Verarbeitung;
-(6) das Bestehen eines Beschwerderechts bei einer Aufsichtsbehörde;
-(7) alle verfügbaren Informationen über die Herkunft der Daten, wenn die personenbezogenen Daten nicht bei der betroffenen Person erhoben werden;
-(8) das Bestehen einer automatisierten Entscheidungsfindung einschließlich Profiling gemäß Art. 22 Abs. 1 und 4 DSGVO und – zumindest in diesen Fällen – aussagekräftige Informationen über die involvierte Logik sowie die Tragweite und die angestrebten Auswirkungen einer derartigen Verarbeitung für die betroffene Person.
-Ihnen steht das Recht zu, Auskunft darüber zu verlangen, ob die Sie betreffenden personenbezogenen Daten in ein Drittland oder an eine internationale Organisation übermittelt werden. In diesem Zusammenhang können Sie verlangen, über die geeigneten Garantien gem. Art. 46 DSGVO im Zusammenhang mit der Übermittlung unterrichtet zu werden.
-Sie haben ein Recht auf Berichtigung und/oder Vervollständigung gegenüber dem Verantwortlichen, sofern die verarbeiteten personenbezogenen Daten, die Sie betreffen, unrichtig oder unvollständig sind. Der Verantwortliche hat die Berichtigung unverzüglich vorzunehmen.
-Unter den folgenden Voraussetzungen können Sie die Einschränkung der Verarbeitung der Sie betreffenden personenbezogenen Daten verlangen:
-(1) wenn Sie die Richtigkeit der Sie betreffenden personenbezogenen für eine Dauer bestreiten, die es dem Verantwortlichen ermöglicht, die Richtigkeit der personenbezogenen Daten zu überprüfen;
-(2) die Verarbeitung unrechtmäßig ist und Sie die Löschung der personenbezogenen Daten ablehnen und stattdessen die Einschränkung der Nutzung der personenbezogenen Daten verlangen;
-(3) der Verantwortliche die personenbezogenen Daten für die Zwecke der Verarbeitung nicht länger benötigt, Sie diese jedoch zur Geltendmachung, Ausübung oder Verteidigung von Rechtsansprüchen benötigen, oder
-(4) wenn Sie Widerspruch gegen die Verarbeitung gemäß Art. 21 Abs. 1 DSGVO eingelegt haben und noch nicht feststeht, ob die berechtigten Gründe des Verantwortlichen gegenüber Ihren Gründen überwiegen.
-Wurde die Verarbeitung der Sie betreffenden personenbezogenen Daten eingeschränkt, dürfen diese Daten – von ihrer Speicherung abgesehen – nur mit Ihrer Einwilligung oder zur Geltendmachung, Ausübung oder Verteidigung von Rechtsansprüchen oder zum Schutz der Rechte einer anderen natürlichen oder juristischen Person oder aus Gründen eines wichtigen öffentlichen Interesses der Union oder eines Mitgliedstaats verarbeitet werden.
-Wurde die Einschränkung der Verarbeitung nach den o.g. Voraussetzungen eingeschränkt, werden Sie von dem Verantwortlichen unterrichtet, bevor die Einschränkung aufgehoben wird.
-Sie können von dem Verantwortlichen verlangen, dass die Sie betreffenden personenbezogenen Daten unverzüglich gelöscht werden, und der Verantwortliche ist verpflichtet, diese Daten unverzüglich zu löschen, sofern einer der folgenden Gründe zutrifft:
-(1) Die Sie betreffenden personenbezogenen Daten sind für die Zwecke, für die sie erhoben oder auf sonstige Weise verarbeitet wurden, nicht mehr notwendig.
-(2) Sie widerrufen Ihre Einwilligung, auf die sich die Verarbeitung gem. Art. 6 Abs. 1 lit. a oder Art. 9 Abs. 2 lit. a DSGVO stützte, und es fehlt an einer anderweitigen Rechtsgrundlage für die Verarbeitung.
-(3) Sie legen gem. Art. 21 Abs. 1 DSGVO Widerspruch gegen die Verarbeitung ein und es liegen keine vorrangigen berechtigten Gründe für die Verarbeitung vor, oder Sie legen gem. Art. 21 Abs. 2 DSGVO Widerspruch gegen die Verarbeitung ein.
-(4) Die Sie betreffenden personenbezogenen Daten wurden unrechtmäßig verarbeitet.
-(5) Die Löschung der Sie betreffenden personenbezogenen Daten ist zur Erfüllung einer rechtlichen Verpflichtung nach dem Unionsrecht oder dem Recht der Mitgliedstaaten erforderlich, dem der Verantwortliche unterliegt.
-(6) Die Sie betreffenden personenbezogenen Daten wurden in Bezug auf angebotene Dienste der Informationsgesellschaft gemäß Art. 8 Abs. 1 DSGVO erhoben.
-Hat der Verantwortliche die Sie betreffenden personenbezogenen Daten öffentlich gemacht und ist er gem. Art. 17 Abs. 1 DSGVO zu deren Löschung verpflichtet, so trifft er unter Berücksichtigung der verfügbaren Technologie und der Implementierungskosten angemessene Maßnahmen, auch technischer Art, um für die Datenverarbeitung Verantwortliche, die die personenbezogenen Daten verarbeiten, darüber zu informieren, dass Sie als betroffene Person von ihnen die Löschung aller Links zu diesen personenbezogenen Daten oder von Kopien oder Replikationen dieser personenbezogenen Daten verlangt haben.
-Das Recht auf Löschung besteht nicht, soweit die Verarbeitung erforderlich ist
-(1) zur Ausübung des Rechts auf freie Meinungsäußerung und Information;
-(2) zur Erfüllung einer rechtlichen Verpflichtung, die die Verarbeitung nach dem Recht der Union oder der Mitgliedstaaten, dem der Verantwortliche unterliegt, erfordert, oder zur Wahrnehmung einer Aufgabe, die im öffentlichen Interesse liegt oder in Ausübung öffentlicher Gewalt erfolgt, die dem Verantwortlichen übertragen wurde;
-(3) aus Gründen des öffentlichen Interesses im Bereich der öffentlichen Gesundheit gemäß Art. 9 Abs. 2 lit. h und i sowie Art. 9 Abs. 3 DSGVO;
-(4) für im öffentlichen Interesse liegende Archivzwecke, wissenschaftliche oder historische Forschungszwecke oder für statistische Zwecke gem. Art. 89 Abs. 1 DSGVO, soweit das unter Abschnitt a) genannte Recht voraussichtlich die Verwirklichung der Ziele dieser Verarbeitung unmöglich macht oder ernsthaft beeinträchtigt, oder
-(5) zur Geltendmachung, Ausübung oder Verteidigung von Rechtsansprüchen.
-Haben Sie das Recht auf Berichtigung, Löschung oder Einschränkung der Verarbeitung gegenüber dem Verantwortlichen geltend gemacht, ist dieser verpflichtet, allen Empfängern, denen die Sie betreffenden personenbezogenen Daten offengelegt wurden, diese Berichtigung oder Löschung der Daten oder Einschränkung der Verarbeitung mitzuteilen, es sei denn, dies erweist sich als unmöglich oder ist mit einem unverhältnismäßigen Aufwand verbunden.
-Ihnen steht gegenüber dem Verantwortlichen das Recht zu, über diese Empfänger unterrichtet zu werden.
-Sie haben das Recht, die Sie betreffenden personenbezogenen Daten, die Sie dem Verantwortlichen bereitgestellt haben, in einem strukturierten, gängigen und maschinenlesbaren Format zu erhalten. Außerdem haben Sie das Recht diese Daten einem anderen Verantwortlichen ohne Behinderung durch den Verantwortlichen, dem die personenbezogenen Daten bereitgestellt wurden, zu übermitteln, sofern
-(1) die Verarbeitung auf einer Einwilligung gem. Art. 6 Abs. 1 lit. a DSGVO oder Art. 9 Abs. 2 lit. a DSGVO oder auf einem Vertrag gem. Art. 6 Abs. 1 lit. b DSGVO beruht und
-(2) die Verarbeitung mithilfe automatisierter Verfahren erfolgt.
-In Ausübung dieses Rechts haben Sie ferner das Recht, zu erwirken, dass die Sie betreffenden personenbezogenen Daten direkt von einem Verantwortlichen einem anderen Verantwortlichen übermittelt werden, soweit dies technisch machbar ist. Freiheiten und Rechte anderer Personen dürfen hierdurch nicht beeinträchtigt werden.
-Das Recht auf Datenübertragbarkeit gilt nicht für eine Verarbeitung personenbezogener Daten, die für die Wahrnehmung einer Aufgabe erforderlich ist, die im öffentlichen Interesse liegt oder in Ausübung öffentlicher Gewalt erfolgt, die dem Verantwortlichen übertragen wurde.
-Sie haben das Recht, aus Gründen, die sich aus ihrer besonderen Situation ergeben, jederzeit gegen die Verarbeitung der Sie betreffenden personenbezogenen Daten, die aufgrund von Art. 6 Abs. 1 lit. e oder f DSGVO erfolgt, Widerspruch einzulegen; dies gilt auch für ein auf diese Bestimmungen gestütztes Profiling.
-Der Verantwortliche verarbeitet die Sie betreffenden personenbezogenen Daten nicht mehr, es sei denn, er kann zwingende schutzwürdige Gründe für die Verarbeitung nachweisen, die Ihre Interessen, Rechte und Freiheiten überwiegen, oder die Verarbeitung dient der Geltendmachung, Ausübung oder Verteidigung von Rechtsansprüchen.
-Werden die Sie betreffenden personenbezogenen Daten verarbeitet, um Direktwerbung zu betreiben, haben Sie das Recht, jederzeit Widerspruch gegen die Verarbeitung der Sie betreffenden personenbezogenen Daten zum Zwecke derartiger Werbung einzulegen; dies gilt auch für das Profiling, soweit es mit solcher Direktwerbung in Verbindung steht.
-Widersprechen Sie der Verarbeitung für Zwecke der Direktwerbung, so werden die Sie betreffenden personenbezogenen Daten nicht mehr für diese Zwecke verarbeitet.
-Sie haben die Möglichkeit, im Zusammenhang mit der Nutzung von Diensten der Informationsgesellschaft – ungeachtet der Richtlinie 2002/58/EG – Ihr Widerspruchsrecht mittels automatisierter Verfahren auszuüben, bei denen technische Spezifikationen verwendet werden.
-Sie haben das Recht, Ihre datenschutzrechtliche Einwilligungserklärung jederzeit zu widerrufen. Durch den Widerruf der Einwilligung wird die Rechtmäßigkeit der aufgrund der Einwilligung bis zum Widerruf erfolgten Verarbeitung nicht berührt.
-Sie haben das Recht, nicht einer ausschließlich auf einer automatisierten Verarbeitung – einschließlich Profiling – beruhenden Entscheidung unterworfen zu werden, die Ihnen gegenüber rechtliche Wirkung entfaltet oder Sie in ähnlicher Weise erheblich beeinträchtigt. Dies gilt nicht, wenn die Entscheidung
-(1) für den Abschluss oder die Erfüllung eines Vertrags zwischen Ihnen und dem Verantwortlichen erforderlich ist,
-(2) aufgrund von Rechtsvorschriften der Union oder der Mitgliedstaaten, denen der Verantwortliche unterliegt, zulässig ist und diese Rechtsvorschriften angemessene Maßnahmen zur Wahrung Ihrer Rechte und Freiheiten sowie Ihrer berechtigten Interessen enthalten oder
-(3) mit Ihrer ausdrücklichen Einwilligung erfolgt.
-Allerdings dürfen diese Entscheidungen nicht auf besonderen Kategorien personenbezogener Daten nach Art. 9 Abs. 1 DSGVO beruhen, sofern nicht Art. 9 Abs. 2 lit. a oder g DSGVO gilt und angemessene Maßnahmen zum Schutz der Rechte und Freiheiten sowie Ihrer berechtigten Interessen getroffen wurden.
-Hinsichtlich der in (1) und (3) genannten Fälle trifft der Verantwortliche angemessene Maßnahmen, um die Rechte und Freiheiten sowie Ihre berechtigten Interessen zu wahren, wozu mindestens das Recht auf Erwirkung des Eingreifens einer Person seitens des Verantwortlichen, auf Darlegung des eigenen Standpunkts und auf Anfechtung der Entscheidung gehört.
-Unbeschadet eines anderweitigen verwaltungsrechtlichen oder gerichtlichen Rechtsbehelfs steht Ihnen das Recht auf Beschwerde bei einer Aufsichtsbehörde, insbesondere in dem Mitgliedstaat ihres Aufenthaltsorts, ihres Arbeitsplatzes oder des Orts des mutmaßlichen Verstoßes, zu, wenn Sie der Ansicht sind, dass die Verarbeitung der Sie betreffenden personenbezogenen Daten gegen die DSGVO verstößt.
-Die Aufsichtsbehörde, bei der die Beschwerde eingereicht wurde, unterrichtet den Beschwerdeführer über den Stand und die Ergebnisse der Beschwerde einschließlich der Möglichkeit eines gerichtlichen Rechtsbehelfs nach Art. 78 DSGVO.
-You can easily integrate Spring Boot Admin with Flask or FastAPI Python applications using the Pyctuator project.
-The following steps uses Flask, but other web frameworks are supported as well. See Pyctuator’s documentation for an updated list of supported frameworks and features.
-Install the pyctuator package:
-pip install pyctuator
- Enable pyctuator by pointing it to your Flask app and letting it know where Spring Boot Admin is running:
-import os
-from flask import Flask
-from pyctuator.pyctuator import Pyctuator
-
-app_name = "Flask App with Pyctuator"
-app = Flask(app_name)
-
-
-@app.route("/")
-def hello():
- return "Hello World!"
-
-
-Pyctuator(
- app,
- app_name,
- app_url="http://example-app.com",
- pyctuator_endpoint_url="http://example-app.com/pyctuator",
- registration_url=os.getenv("SPRING_BOOT_ADMIN_URL")
-)
-
-app.run()
- For further details and examples, see Pyctuator’s documentation and examples.
-Since there are several approaches on solving authentication and authorization in distributed web applications Spring Boot Admin doesn’t ship a default one. By default spring-boot-admin-server-ui
provides a login page and a logout button.
A Spring Security configuration for your server could look like this:
-@Configuration(proxyBeanMethods = false)
-public class SecuritySecureConfig {
-
- private final AdminServerProperties adminServer;
-
- private final SecurityProperties security;
-
- public SecuritySecureConfig(AdminServerProperties adminServer, SecurityProperties security) {
- this.adminServer = adminServer;
- this.security = security;
- }
-
- @Bean
- protected SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
- SavedRequestAwareAuthenticationSuccessHandler successHandler = new SavedRequestAwareAuthenticationSuccessHandler();
- successHandler.setTargetUrlParameter("redirectTo");
- successHandler.setDefaultTargetUrl(this.adminServer.path("/"));
-
- http.authorizeHttpRequests((authorizeRequests) -> authorizeRequests //
- .requestMatchers(new AntPathRequestMatcher(this.adminServer.path("/assets/**")))
- .permitAll() (1)
- .requestMatchers(new AntPathRequestMatcher(this.adminServer.path("/actuator/info")))
- .permitAll()
- .requestMatchers(new AntPathRequestMatcher(adminServer.path("/actuator/health")))
- .permitAll()
- .requestMatchers(new AntPathRequestMatcher(this.adminServer.path("/login")))
- .permitAll()
- .dispatcherTypeMatchers(DispatcherType.ASYNC)
- .permitAll() // https://github.com/spring-projects/spring-security/issues/11027
- .anyRequest()
- .authenticated()) (2)
- .formLogin(
- (formLogin) -> formLogin.loginPage(this.adminServer.path("/login")).successHandler(successHandler)) (3)
- .logout((logout) -> logout.logoutUrl(this.adminServer.path("/logout")))
- .httpBasic(Customizer.withDefaults()); (4)
-
- http.addFilterAfter(new CustomCsrfFilter(), BasicAuthenticationFilter.class) (5)
- .csrf((csrf) -> csrf.csrfTokenRepository(CookieCsrfTokenRepository.withHttpOnlyFalse())
- .csrfTokenRequestHandler(new CsrfTokenRequestAttributeHandler())
- .ignoringRequestMatchers(
- new AntPathRequestMatcher(this.adminServer.path("/instances"), POST.toString()), (6)
- new AntPathRequestMatcher(this.adminServer.path("/instances/*"), DELETE.toString()), (6)
- new AntPathRequestMatcher(this.adminServer.path("/actuator/**")) (7)
- ));
-
- http.rememberMe((rememberMe) -> rememberMe.key(UUID.randomUUID().toString()).tokenValiditySeconds(1209600));
-
- return http.build();
-
- }
-
- // Required to provide UserDetailsService for "remember functionality"
- @Bean
- public InMemoryUserDetailsManager userDetailsService(PasswordEncoder passwordEncoder) {
- UserDetails user = User.withUsername("user").password(passwordEncoder.encode("password")).roles("USER").build();
- return new InMemoryUserDetailsManager(user);
- }
-
- @Bean
- public PasswordEncoder passwordEncoder() {
- return new BCryptPasswordEncoder();
- }
-
-}
- 1 | -Grants public access to all static assets and the login page. | -
2 | -Every other request must be authenticated. | -
3 | -Configures login and logout. | -
4 | -Enables HTTP-Basic support. This is needed for the Spring Boot Admin Client to register. | -
5 | -Enables CSRF-Protection using Cookies | -
6 | -Disables CSRF-Protection for the endpoint the Spring Boot Admin Client uses to (de-)register. | -
7 | -Disables CSRF-Protection for the actuator endpoints. | -
In case you use the Spring Boot Admin Client, it needs the credentials for accessing the server:
-spring.boot.admin.client:
- username: sba-client
- password: s3cret
- For a complete sample look at spring-boot-admin-sample-servlet.
-- | If you protect the /instances endpoint don’t forget to configure the username and password on your SBA-Client using spring.boot.admin.client.username and spring.boot.admin.client.password . |
-
When the actuator endpoints are secured using HTTP Basic authentication the SBA Server needs credentials to access them. You can submit the credentials in the metadata when registering the application. The BasicAuthHttpHeaderProvider
then uses this metadata to add the Authorization
header to access your application’s actuator endpoints. You can provide your own HttpHeadersProvider
to alter the behaviour (e.g. add some decryption) or add extra headers.
- | The SBA Server masks certain metadata in the HTTP interface to prevent leaking of sensitive information. | -
- | You should configure HTTPS for your SBA Server or (service registry) when submitting credentials via the metadata. | -
- | When using Spring Cloud Discovery, you must be aware that anybody who can query your service registry can obtain the credentials. | -
- | When using this approach the SBA Server decides whether or not the user can access the registered applications. There are more complex solutions possible (using OAuth2) to let the clients decide if the user can access the endpoints. For that please have a look at the samples in joshiste/spring-boot-admin-samples. | -
spring.boot.admin.client:
- url: http://localhost:8080
- instance:
- metadata:
- user.name: ${spring.security.user.name}
- user.password: ${spring.security.user.password}
- You can specify credentials via configuration properties in your admin server.
-- | You can use this in conjuction with spring-cloud-kubernetes to pull credentials from secrets. | -
To enable pulling credentials from properties the spring.boot.admin.instance-auth.enabled
property must be true
(default).
- | If your clients provide credentials via metadata (i.e., via service annotations), that metadata will be used instead of the properites. | -
You can provide a default username and password by setting spring.boot.admin.instance-auth.default-user-name
and spring.boot.admin.instance-auth.default-user-password
. Optionally you can provide credentials for specific services (by name) using the spring.boot.admin.instance-auth.service-map.*.user-name
pattern, replacing *
with the service name.
spring.boot.admin:
- instance-auth:
- enabled: true
- default-user-name: "${some.user.name.from.secret}"
- default-password: "${some.user.password.from.secret}"
- service-map:
- my-first-service-to-monitor:
- user-name: "${some.user.name.from.secret}"
- user-password: "${some.user.password.from.secret}"
- my-second-service-to-monitor:
- user-name: "${some.user.name.from.secret}"
- user-password: "${some.user.password.from.secret}"
- eureka:
- instance:
- metadata-map:
- user.name: ${spring.security.user.name}
- user.password: ${spring.security.user.password}
- spring.cloud.consul:
- discovery:
- metadata:
- user-name: ${spring.security.user.name}
- user-password: ${spring.security.user.password}
- - | Consul does not allow dots (".") in metadata keys, use dashes instead. | -
Some of the actuator endpoints (e.g. /loggers
) support POST requests. When using Spring Security you need to ignore the actuator endpoints for CSRF-Protection as the Spring Boot Admin Server currently lacks support.
@Bean
-protected SecurityFilterChain filterChain(HttpSecurity http) {
- return http.csrf(c -> c.ignoringRequestMatchers("/actuator/**")).build();
-}
- SBA Server can also use client certificates to authenticate when accessing the actuator endpoints. If a custom configured ClientHttpConnector
bean is present, Spring Boot will automatically configure a WebClient.Builder
using it, which will be used by Spring Boot Admin.
@Bean
-public ClientHttpConnector customHttpClient() {
- SslContextBuilder sslContext = SslContextBuilder.forClient();
- //Your sslContext customizations go here
- HttpClient httpClient = HttpClient.create().secure(
- ssl -> ssl.sslContext(sslContext)
- );
- return new ReactorClientHttpConnector(httpClient);
-}
- Mail notifications will be delivered as HTML emails rendered using Thymeleaf templates. To enable Mail notifications, configure a JavaMailSender
using spring-boot-starter-mail
and set a recipient.
- | To prevent disclosure of sensitive information, the default mail template doesn’t show any metadata of the instance. If you want to you show some of the metadata you can use a custom template. | -
Add spring-boot-starter-mail to your dependencies:
-<dependency>
- <groupId>org.springframework.boot</groupId>
- <artifactId>spring-boot-starter-mail</artifactId>
-</dependency>
- Configure a JavaMailSender
-spring.mail.host=smtp.example.com -spring.boot.admin.notify.mail.to=admin@example.com-
Configure the mail with the options below
-Property name | -Description | -Default value | -
---|---|---|
spring.boot.admin.notify.mail.enabled |
- Enable mail notifications |
-
|
-
spring.boot.admin.notify.mail.ignore-changes |
- Comma-delimited list of status changes to be ignored. Format: "<from-status>:<to-status>". Wildcards allowed. |
-
|
-
spring.boot.admin.notify.mail.template |
- Resource path to the Thymeleaf template used for rendering. |
-
|
-
spring.boot.admin.notify.mail.to |
- Comma-delimited list of mail recipients |
-
|
-
spring.boot.admin.notify.mail.cc |
- Comma-delimited list of carbon-copy recipients |
- - |
spring.boot.admin.notify.mail.from |
- Mail sender |
-
|
-
spring.boot.admin.notify.mail.additional-properties |
- Additional properties which can be accessed from the template |
- - |
To enable PagerDuty notifications you just have to add a generic service to your PagerDuty-account and set spring.boot.admin.notify.pagerduty.service-key
to the service-key you received.
Property name | -Description | -Default value | -
---|---|---|
spring.boot.admin.notify.pagerduty.enabled |
- Enable mail notifications |
-
|
-
spring.boot.admin.notify.pagerduty.ignore-changes |
- Comma-delimited list of status changes to be ignored. Format: "<from-status>:<to-status>". Wildcards allowed. |
-
|
-
spring.boot.admin.notify.pagerduty.service-key |
- Service-key to use for PagerDuty |
- - |
spring.boot.admin.notify.pagerduty.url |
- The Pagerduty-rest-api url |
-
|
-
spring.boot.admin.notify.pagerduty.description |
- Description to use in the event. SpEL-expressions are supported |
-
|
-
spring.boot.admin.notify.pagerduty.client |
- Client-name to use in the event |
- - |
spring.boot.admin.notify.pagerduty.client-url |
- Client-url to use in the event |
- - |
To enable OpsGenie notifications you just have to add a new JSON Rest API integration to your OpsGenie account and set spring.boot.admin.notify.opsgenie.api-key
to the apiKey you received.
Property name | -Description | -Default value | -
---|---|---|
spring.boot.admin.notify.opsgenie.enabled |
- Enable OpsGenie notifications |
-
|
-
spring.boot.admin.notify.opsgenie.ignore-changes |
- Comma-delimited list of status changes to be ignored. Format: "<from-status>:<to-status>". Wildcards allowed. |
-
|
-
spring.boot.admin.notify.opsgenie.api-key |
- apiKey you received when creating the integration |
- - |
spring.boot.admin.notify.opsgenie.url |
- OpsGenie Alert API url |
-
|
-
spring.boot.admin.notify.opsgenie.description |
- Description to use in the event. SpEL-expressions are supported |
-
|
-
spring.boot.admin.notify.opsgenie.actions |
- Comma separated list of actions that can be executed. |
- - |
spring.boot.admin.notify.opsgenie.source |
- Field to specify source of alert. By default, it will be assigned to IP address of incoming request. |
- - |
spring.boot.admin.notify.opsgenie.tags |
- Comma separated list of labels attached to the alert. |
- - |
spring.boot.admin.notify.opsgenie.entity |
- The entity the alert is related to. |
- - |
spring.boot.admin.notify.opsgenie.user |
- Default owner of the execution. If user is not specified, the system becomes owner of the execution. |
- - |
To enable Hipchat notifications you need to create an API token on your Hipchat account and set the appropriate configuration properties.
-Property name | -Description | -Default value | -
---|---|---|
spring.boot.admin.notify.hipchat.enabled |
- Enable Hipchat notifications |
-
|
-
spring.boot.admin.notify.hipchat.ignore-changes |
- Comma-delimited list of status changes to be ignored. Format: "<from-status>:<to-status>". Wildcards allowed. |
-
|
-
spring.boot.admin.notify.hipchat.url |
- The HipChat REST API (V2) URL |
- - |
spring.boot.admin.notify.hipchat.auth-token |
- The API token with access to the notification room |
- - |
spring.boot.admin.notify.hipchat.room-id |
- The ID or url-encoded name of the room to send notifications to |
- - |
spring.boot.admin.notify.hipchat.notify |
- Whether the message should trigger a user notification |
-
|
-
spring.boot.admin.notify.hipchat.description |
- Description to use in the event. SpEL-expressions are supported |
-
|
-
To enable Slack notifications you need to add an incoming Webhook under custom integrations on your Slack account and configure it appropriately.
-Property name | -Description | -Default value | -
---|---|---|
spring.boot.admin.notify.slack.enabled |
- Enable Slack notifications |
-
|
-
spring.boot.admin.notify.slack.ignore-changes |
- Comma-delimited list of status changes to be ignored. Format: "<from-status>:<to-status>". Wildcards allowed. |
-
|
-
spring.boot.admin.notify.slack.webhook-url |
- The Slack Webhook URL to send notifications to. |
- - |
spring.boot.admin.notify.slack.channel |
- Optional channel name (without # at the beginning). If different from channel in Slack Webhooks settings |
- - |
spring.boot.admin.notify.slack.icon |
- Optional icon name (without surrounding colons). If different from icon in Slack Webhooks settings |
- - |
spring.boot.admin.notify.slack.username |
- Optional username to send notification if different from in Slack Webhooks settings |
-
|
-
spring.boot.admin.notify.slack.message |
- Message to use in the event. SpEL-expressions and Slack markups are supported |
-
|
-
To enable Let’s Chat notifications you need to add the host url and add the API token and username from Let’s Chat
-Property name | -Description | -Default value | -
---|---|---|
spring.boot.admin.notify.letschat.enabled |
- Enable let´s Chat notifications |
-
|
-
spring.boot.admin.notify.letschat.ignore-changes |
- Comma-delimited list of status changes to be ignored. Format: "<from-status>:<to-status>". Wildcards allowed. |
-
|
-
spring.boot.admin.notify.letschat.url |
- The let´s Chat Host URL to send notifications |
- - |
spring.boot.admin.notify.letschat.room |
- the room where to send the messages |
- - |
spring.boot.admin.notify.letschat.token |
- the token to access the let´s Chat API |
- - |
spring.boot.admin.notify.letschat.username |
- The username for which the token was created |
-
|
-
spring.boot.admin.notify.letschat.message |
- Message to use in the event. SpEL-expressions are supported |
-
|
-
To enable Microsoft Teams notifications you need to set up a connector webhook url and set the appropriate configuration property.
-Property name | -Description | -Default value | -
---|---|---|
spring.boot.admin.notify.ms-teams.enabled |
- Enable Microsoft Teams notifications |
-
|
-
spring.boot.admin.notify.ms-teams.webhook-url |
- The Microsoft Teams webhook url to send the notifications to. |
- - |
spring.boot.admin.notify.ms-teams.deRegisteredTitle |
- Title of the Teams message when an app de-registers. |
- De-Registered |
-
spring.boot.admin.notify.ms-teams.registeredTitle |
- Title of the Teams message when an app dregisters. |
- Registered |
-
spring.boot.admin.notify.ms-teams.statusChangedTitle |
- Title of the Teams message when an app changes status. |
- Status Changed |
-
spring.boot.admin.notify.ms-teams.messageSummary |
- Summary section of every Teams message originating from Spring Boot Admin. |
- Spring Boot Admin Notification |
-
spring.boot.admin.notify.ms-teams.theme_color |
- Set the theme color. SpEL-expressions are supported. |
-
|
-
spring.boot.admin.notify.ms-teams.deregister_activity_subtitle |
- Subtitle of the Activity section of the Teams message when an app de-registers. SpEL-expressions are supported. |
-
|
-
spring.boot.admin.notify.ms-teams.register_activity_subtitle |
- Subtitle of the Activity section of the Teams message when an app registers. SpEL-expressions are supported. |
-
|
-
spring.boot.admin.notify.ms-teams.status_activity_subtitle |
- Subtitle of the Activity section of the Teams message when an app changes status. SpEL-expressions are supported. |
-
|
-
To enable Telegram notifications you need to create and authorize a telegram bot and set the appropriate configuration properties for auth-token and chat-id.
-Property name | -Description | -Default value | -
---|---|---|
spring.boot.admin.notify.telegram.enabled |
- Enable Telegram notifications |
-
|
-
spring.boot.admin.notify.telegram.auth-token |
- The token identifying und authorizing your Telegram bot (e.g. |
- - |
spring.boot.admin.notify.telegram.chat-id |
- Unique identifier for the target chat or username of the target channel |
- - |
spring.boot.admin.notify.telegram.disable-notify |
- If true users will receive a notification with no sound. |
-
|
-
spring.boot.admin.notify.telegram.parse_mode |
- The parsing mode for the sent message. Currently, |
-
|
-
spring.boot.admin.notify.telegram.message |
- Text to send. SpEL-expressions are supported. |
-
|
-
To enable Webex notifications, you need to set the appropriate configuration properties for auth-token
and room-id
.
Property name | -Description | -Default value | -
---|---|---|
spring.boot.admin.notify.webex.enabled |
- Enable Webex notifications |
-
|
-
spring.boot.admin.notify.webex.url |
- The Webex server url to send the notifications to. |
- "https://webexapis.com/v1/messages" |
-
spring.boot.admin.notify.webex.auth-token |
- The authentication token for your Webex account (e.g. |
- - |
spring.boot.admin.notify.webex.room-id |
- Unique identifier for the target room in Webex. |
- - |
spring.boot.admin.notify.webex.message |
- Text to send. SpEL-expressions are supported. By default, messages will be sent as Markdown, so you can include Markdown formatting. |
-
|
-
To enable Discord notifications you need to create a webhook and set the appropriate configuration property.
-Property name | -Description | -Default value | -
---|---|---|
spring.boot.admin.notify.discord.enabled |
- Enable Discord notifications |
-
|
-
spring.boot.admin.notify.discord.webhook-url |
- The Discord webhook url to send the notifications to. |
- - |
spring.boot.admin.notify.discord.username |
- Optional username. |
- Default set in Discord |
-
spring.boot.admin.notify.discord.avatar-url |
- Optional URL to avatar. |
- Default set in Discord |
-
spring.boot.admin.notify.discord.tts |
- If the message is a text to speech message. |
-
|
-
spring.boot.admin.notify.discord.message |
- Text to send. SpEL-expressions are supported. |
-
|
-
All Notifiers which are using a RestTemplate
can be configured to use a proxy.
Property name | -Description | -Default value | -
---|---|---|
spring.boot.admin.notify.proxy.host |
- The proxy host |
- - |
spring.boot.admin.notify.proxy.port |
- The proxy port |
- - |
spring.boot.admin.notify.proxy.username |
- The proxy username (if proxy requires authentication) |
- - |
spring.boot.admin.notify.proxy.password |
- The proxy password (if proxy requires authentication) |
- - |
The RemindingNotifier
sends reminders for down/offline applications, it delegates the sending of notifications to another notifier.
By default, a reminder is triggered when a registered application changes to DOWN
or OFFLINE
. You can alter this behaviour via setReminderStatuses()
. The reminder ends when either the status changes to a non-triggering status or the regarding application gets deregistered.
By default, the reminders are sent every 10 minutes, to change this use setReminderPeriod()
. The RemindingNotifier
itself doesn’t start the background thread to send the reminders, you need to take care of this as shown in the given example below;
@Configuration
-public class NotifierConfiguration {
- @Autowired
- private Notifier notifier;
-
- @Primary
- @Bean(initMethod = "start", destroyMethod = "stop")
- public RemindingNotifier remindingNotifier() {
- RemindingNotifier notifier = new RemindingNotifier(notifier, repository);
- notifier.setReminderPeriod(Duration.ofMinutes(10)); (1)
- notifier.setCheckReminderInverval(Duration.ofSeconds(10)); (2)
- return notifier;
- }
-}
- 1 | -The reminders will be sent every 10 minutes. | -
2 | -Schedules sending of due reminders every 10 seconds. | -
The FilteringNotifier
allows you to filter certain notification based on rules you can add/remove at runtime. It delegates the sending of notifications to another notifier.
If you add a FilteringNotifier
to your ApplicationContext
a RESTful interface on notifications/filter
gets available. The restful interface provides the following methods for getting, adding, and deleting notification filters:
GET notifications/filter
Returns a list of all registered notification filters. Each containing the attributes id
, applicationName
, expiry
, and expired
.
POST notifications/filters?instanceId=<yourInstanceId>&applicationName=<yourApplicationName>&ttl=<yourInstant>
Posts a new notification filter for the application/instance of the given instanceId
or applicationName
. Either instanceId
or applicationName
must be set. The parameter ttl
is optional and represents the expiration of the filter as an instant (the number of seconds from the epoch of 1970-01-01T00:00:00Z
).
DELETE notifications/filters/{id}
Deletes the notification filter with the requested id from the filters.
You may as well access all notification filter configurations via the main applications view inside SBA client, as seen in the screenshot below.
-A FilteringNotifier
might be useful, for instance, if you don’t want to receive notifications when deploying your applications. Before stopping the application, you can add an (expiring) filter via a POST
request.
@Configuration(proxyBeanMethods = false)
-public class NotifierConfig {
-
- private final InstanceRepository repository;
-
- private final ObjectProvider<List<Notifier>> otherNotifiers;
-
- public NotifierConfig(InstanceRepository repository, ObjectProvider<List<Notifier>> otherNotifiers) {
- this.repository = repository;
- this.otherNotifiers = otherNotifiers;
- }
-
- @Bean
- public FilteringNotifier filteringNotifier() { (1)
- CompositeNotifier delegate = new CompositeNotifier(this.otherNotifiers.getIfAvailable(Collections::emptyList));
- return new FilteringNotifier(delegate, this.repository);
- }
-
- @Primary
- @Bean(initMethod = "start", destroyMethod = "stop")
- public RemindingNotifier remindingNotifier() { (2)
- RemindingNotifier notifier = new RemindingNotifier(filteringNotifier(), this.repository);
- notifier.setReminderPeriod(Duration.ofMinutes(10));
- notifier.setCheckReminderInverval(Duration.ofSeconds(10));
- return notifier;
- }
-
-}
- 1 | -Add the FilteringNotifier bean using a delegate (e.g. MailNotifier when configured) |
-
2 | -Add the RemindingNotifier as primary bean using the FilteringNotifier as delegate. |
-
- | This example combines the reminding and filtering notifiers. This allows you to get notifications after the deployed application hasn’t restarted in a certain amount of time (until the filter expires). | -
To enable DingTalk notifications you need to create and authorize a dingtalk bot and set the appropriate configuration properties for webhookUrl and secret.
-Property name | -Description | -Default value | -
---|---|---|
spring.boot.admin.notify.dingtalk.enabled |
- Enable DingTalk notifications. |
-
|
-
spring.boot.admin.notify.dingtalk.webhook-url |
- The DingTalk webhook url to send the notifications to. |
- - |
spring.boot.admin.notify.dingtalk.secret |
- The secret to get message sign. |
- - |
spring.boot.admin.notify.dingtalk.message |
- Text to send. SpEL-expressions are supported. |
-
|
-
To enable Rocket.Chat notifications you need a personal token access and create a room to send message with this token
-Property name | -Description | -Default value | -
---|---|---|
spring.boot.admin.notify.rocketchat.enabled |
- Enable RocketChat notifications. |
-
|
-
spring.boot.admin.notify.rocketchat.url |
- The RocketChat server url to send the notifications to. |
- - |
spring.boot.admin.notify.rocketchat.userId |
- User id user |
- - |
spring.boot.admin.notify.rocketchat.token |
- Generated token user |
- - |
spring.boot.admin.notify.rocketchat.roomId |
- The room id to send the message |
- - |
spring.boot.admin.notify.rocketchat.message |
- Text to send. SpEL-expressions are supported. |
-
|
-
In case the Spring Boot Admin server is running behind a reverse proxy, it may be requried to configure the public url where the server is reachable via (spring.boot.admin.ui.public-url
). In addition when the reverse proxy terminates the https connection, it may be necessary to configure server.forward-headers-strategy=native
(also see Spring Boot Reference Guide).
Property name | -Description | -Default value | -
---|---|---|
spring.boot.admin.server.enabled |
- Enables the Spring Boot Admin Server. |
-
|
-
spring.boot.admin.context-path |
- The context-path prefixes the path where the Admin Server’s static assets and API should be served, relative to the Dispatcher-Servlet. |
- - |
spring.boot.admin.monitor.status-interval |
- Time interval to check the status of instances. |
- 10,000ms |
-
spring.boot.admin.monitor.status-max-backoff |
- The maximal backoff for status check retries (retry after error has exponential backoff, minimum backoff is 1 second). |
- 60,000ms |
-
spring.boot.admin.monitor.status-lifetime |
- Lifetime of status. The status won’t be updated as long the last status isn’t expired. |
- 10,000ms |
-
spring.boot.admin.monitor.info-interval |
- Time interval to check the info of instances. |
- 1m |
-
spring.boot.admin.monitor.info-max-backoff |
- The maximal backoff for info check retries (retry after error has exponential backoff, minimum backoff is 1 second). |
- 10m |
-
spring.boot.admin.monitor.info-lifetime |
- Lifetime of info. The info won’t be updated as long the last info isn’t expired. |
- 1m |
-
spring.boot.admin.monitor.default-timeout |
- Default timeout when making requests. Individual values for specific endpoints can be overridden using |
- 10,000 |
-
spring.boot.admin.monitor.timeout.* |
- Key-Value-Pairs with the timeout per endpointId. Defaults to default-timeout. |
- - |
spring.boot.admin.monitor.default-retries |
- Default number of retries for failed requests. Modifying requests ( |
- 0 |
-
spring.boot.admin.monitor.retries.* |
- Key-Value-Pairs with the number of retries per endpointId. Defaults to default-retries. Modifying requests ( |
- - |
spring.boot.admin.metadata-keys-to-sanitize |
- Metadata values for the keys matching these regex patterns will be sanitized in all json output. Starting from Spring Boot 3, all actuator values are masked by default. Take a look at the Spring Boot documentation in order to configure unsanitizing of values (Sanitize Sensitive Values). |
-
|
-
spring.boot.admin.probed-endpoints |
- For Spring Boot 1.x client applications SBA probes for the specified endpoints using an OPTIONS request. If the path differs from the id you can specify this as id:path (e.g. health:ping).. |
-
|
-
spring.boot.admin.instance-auth.enabled |
- Enable pulling credentials from spring configuration properties |
-
|
-
spring.boot.admin.instance-auth.default-user-name |
- A default user name used to authenticate to registered services. The |
-
|
-
spring.boot.admin.instance-auth.default-password |
- A default user password used to authenticate to registered services. The |
-
|
-
spring.boot.admin.instance-auth.service-map.*.user-name |
- A user name used to authenticate to the registered service with the specified name. The |
- - |
spring.boot.admin.instance-auth.service-map.*.user-password |
- A user password used to authenticate to the registered service with the specified name. The |
- - |
spring.boot.admin.instance-proxy.ignored-headers |
- Headers not to be forwarded when making requests to clients. |
-
|
-
spring.boot.admin.ui.public-url |
- Base url to use to build the base href in the ui. |
- If running behind a reverse proxy (using path rewriting) this can be used to make correct self references. If the host/port is omitted it will be inferred from the request. |
-
spring.boot.admin.ui.brand |
- Brand to be shown in the navbar. |
-
|
-
spring.boot.admin.ui.title |
- Page-Title to be shown. |
-
|
-
spring.boot.admin.ui.login-icon |
- Icon used as image on login page. |
-
|
-
spring.boot.admin.ui.favicon |
- Icon used as default favicon and icon for desktop notifications. |
-
|
-
spring.boot.admin.ui.favicon-danger |
- Icon used as favicon when one or more service is down and for desktop notifications. |
-
|
-
spring.boot.admin.ui.remember-me-enabled |
- Switch to show/hide the remember-me checkbox on the login page. |
-
|
-
spring.boot.admin.ui.poll-timer.cache |
- Polling duration in ms to fetch new cache data. |
-
|
-
spring.boot.admin.ui.poll-timer.datasource |
- Polling duration in ms to fetch new datasource data. |
-
|
-
spring.boot.admin.ui.poll-timer.gc |
- Polling duration in ms to fetch new gc data. |
-
|
-
spring.boot.admin.ui.poll-timer.process |
- Polling duration in ms to fetch new process data. |
-
|
-
spring.boot.admin.ui.poll-timer.memory |
- Polling duration in ms to fetch new memory data. |
-
|
-
spring.boot.admin.ui.poll-timer.threads |
- Polling duration in ms to fetch new threads data. |
-
|
-
spring.boot.admin.ui.poll-timer.logfile |
- Polling duration in ms to fetch new logfile data. |
-
|
-
spring.boot.admin.ui.enable-toasts |
- Allows to enable toast notifications. |
-
|
-
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 provides a SimpleDiscoveryClient
. It allows you to specify client applications via static configuration:
<dependency>
- <groupId>org.springframework.cloud</groupId>
- <artifactId>spring-cloud-starter</artifactId>
-</dependency>
- spring:
- cloud:
- discovery:
- client:
- simple:
- instances:
- test:
- - uri: http://instance1.intern:8080
- metadata:
- management.context-path: /actuator
- - uri: http://instance2.intern:8080
- metadata:
- management.context-path: /actuator
- Spring Boot Admin supports all other implementations of Spring Cloud’s DiscoveryClient
(Eureka, Zookeeper, Consul, Kubernetes, …). You need to add it to the Spring Boot Admin Server and configure it properly. An example setup using Eureka is shown above.
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.
- | 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 . |
-
- | When using Eureka, the healthCheckUrl known to Eureka is used for health-checking, which can be set on your client using eureka.instance.healthCheckUrl . |
-
Key | -Value | -Default value | -
---|---|---|
user.name |
- Credentials being used to access the endpoints. |
- - |
management.scheme |
- The scheme is substituted in the service URL and will be used for accessing the actuator endpoints. |
- - |
management.address |
- The address is substituted in the service URL and will be used for accessing the actuator endpoints. |
- - |
management.port |
- The port is substituted in the service URL and will be used for accessing the actuator endpoints. |
- - |
management.context-path |
- The path is appended to the service URL and will be used for accessing the actuator endpoints. |
-
|
-
health.path |
- The path is appended to the service URL and will be used for the health-checking. Ignored by the |
-
|
-
group |
- The group is used to group services in the UI by the group name instead of application name. |
- - |
Property name | -Description | -Default value | -
---|---|---|
spring.boot.admin.discovery.enabled |
- Enables the DiscoveryClient-support for the admin server. |
-
|
-
spring.boot.admin.discovery.converter.management-context-path |
- Will be appended to the service-url of the discovered service when the management-url is converted by the |
-
|
-
spring.boot.admin.discovery.converter.health-endpoint-path |
- Will be appended to the management-url of the discovered service when the health-url is converted by the |
-
|
-
spring.boot.admin.discovery.ignored-services |
- This services will be ignored when using discovery and not registered as application. Supports simple patterns (e.g. "foo*", "*bar", "foo*bar*"). |
- - |
spring.boot.admin.discovery.services |
- This services will be included when using discovery and registered as application. Supports simple patterns (e.g. "foo*", "*bar", "foo*bar*"). |
-
|
-
spring.boot.admin.discovery.ignored-instances-metadata |
- Instances of services will be ignored if they contain at least one metadata item that matches this list. (e.g. "discoverable=false") |
- - |
spring.boot.admin.discovery.instances-metadata |
- Instances of services will be included if they contain at least one metadata item that matches this list. (e.g. "discoverable=true") |
- - |
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:
eureka:
- instance:
- hostname: ${vcap.application.uris[0]}
- nonSecurePort: 80
- metadata-map:
- applicationId: ${vcap.application.application_id}
- instanceId: ${vcap.application.instance_index}
- Spring Boot Admin Server supports cluster replication via Hazelcast. It is automatically enabled when a HazelcastConfig
- or HazelcastInstance
-Bean is present. You can also configure the Hazelcast instance to be persistent, to keep the status over restarts. Also have a look at the Spring Boot support for Hazelcast.
Add Hazelcast to your dependencies:
-<dependency>
- <groupId>com.hazelcast</groupId>
- <artifactId>hazelcast</artifactId>
-</dependency>
- Instantiate a HazelcastConfig:
-@Bean
-public Config hazelcastConfig() {
- // This map is used to store the events.
- // It should be configured to reliably hold all the data,
- // Spring Boot Admin will compact the events, if there are too many
- MapConfig eventStoreMap = new MapConfig(DEFAULT_NAME_EVENT_STORE_MAP).setInMemoryFormat(InMemoryFormat.OBJECT)
- .setBackupCount(1)
- .setMergePolicyConfig(new MergePolicyConfig(PutIfAbsentMergePolicy.class.getName(), 100));
-
- // This map is used to deduplicate the notifications.
- // If data in this map gets lost it should not be a big issue as it will atmost
- // lead to
- // the same notification to be sent by multiple instances
- MapConfig sentNotificationsMap = new MapConfig(DEFAULT_NAME_SENT_NOTIFICATIONS_MAP)
- .setInMemoryFormat(InMemoryFormat.OBJECT)
- .setBackupCount(1)
- .setEvictionConfig(
- new EvictionConfig().setEvictionPolicy(EvictionPolicy.LRU).setMaxSizePolicy(MaxSizePolicy.PER_NODE))
- .setMergePolicyConfig(new MergePolicyConfig(PutIfAbsentMergePolicy.class.getName(), 100));
-
- Config config = new Config();
- config.addMapConfig(eventStoreMap);
- config.addMapConfig(sentNotificationsMap);
- config.setProperty("hazelcast.jmx", "true");
-
- // WARNING: This setups a local cluster, you change it to fit your needs.
- config.getNetworkConfig().getJoin().getMulticastConfig().setEnabled(false);
- TcpIpConfig tcpIpConfig = config.getNetworkConfig().getJoin().getTcpIpConfig();
- tcpIpConfig.setEnabled(true);
- tcpIpConfig.setMembers(singletonList("127.0.0.1"));
- return config;
-}
- Property name | -Description | -Default value | -
---|---|---|
spring.boot.admin.hazelcast.enabled |
- Enables the Hazelcast support |
-
|
-
spring.boot.admin.hazelcast.event-store |
- Name of the Hazelcast-map to store the events |
-
|
-
spring.boot.admin.hazelcast.sent-notifications |
- Name of the Hazelcast-map used to deduplicate the notifications. |
-
|
-