Commit 2e37238d by Johannes Edmeier

Update docs (WIP)

parent a241cb7d
* Raised minimum required Java version to 1.8
[[monitoring-spring-boot-1.5.x]]
== Monitoring Spring Boot Applciations 1.5.x ==
* Updade to Spring Boot 2.x
It is possible to monitor Spring Boot 1.5.x applications with Spring Boot Admin 2.x. The old Spring Boot Admin Client is
able to register at a newer server. Since the API has slight changes for you need to set the following property:
* All client properties from `spring.boot.admin.client.*` have been renamed to `sbadmin.client.instance`
. Add reconfigure the api path for Spring Boot Admin Client 1.5.x:
+
[source,yml]
.application.yml
----
spring.boot.admin.api-path: instances
----
* All client properties under `spring.boot.admin.*` have been renamed to `sbadmin.client`.
As some of the actuator endpoints changed with the Spring Boot 2 release not all options might be available
(e.g. `/metrics` endpoint); for some of the endpoints we provide legacy converters.
* All server properties under `spring.boot.admin.*` have been renamed to `sbadmin.*`.
== Changes with 2.x ==
=== UI
* Rewritten ui using vue.js
* Integrated ui-login module into the main ui module
* Removed ui-activiti module, as it was only used rarely
* Added support for the session endpoint
* Added display of the registered metadata
* Added option to reset loglevels
=== Backend
* Moved all classes to the `spring.boot.admin.server` package
* Added stable automatic-module-name
* Redesigned backend based on event sourcing principles
* Moved endpoint detection to the backend by querying the `/actuator`-index
* Added the concept of applications (consisting of 1 to n instances) to the backend
* Removed Zuul
* Removed dependency on spring-cloud-starter
=== Client
* Moved all properties to `spring.boot.admin.client.*` and `spring.boot.admin.client.instance.*`
* Moved all classes to the `spring.boot.admin.client` package
* Added stable automatic-module-name
* Supports webflux and servlet based applications
......@@ -29,7 +29,8 @@ To have the version show up in the application list you can use the `build-info`
[[jmx-bean-management]]
=== JMX-bean management ===
To interact with JMX-beans in the admin UI you have to include https://jolokia.org/[Jolokia] in your application. In case you are using the `spring-boot-admin-starter-client` it will be pulled in for you, if not add Jolokia to your dependencies:
To interact with JMX-beans in the admin UI you have to include https://jolokia.org/[Jolokia] in your application. As Jolokia is servlet based there is no support for reactive applications.
In case you are using the `spring-boot-admin-starter-client` it will be pulled in for you, if not add Jolokia to your dependencies:
[source,xml]
.pom.xml
......@@ -40,23 +41,6 @@ To interact with JMX-beans in the admin UI you have to include https://jolokia.o
</dependency>
----
[[loglevel-management]]
=== Loglevel management ===
For applications using Spring Boot 1.5.x (or later) you can manage loglevels out-of-the-box.
For applications using older versions of Spring Boot the loglevel management is only available for http://logback.qos.ch/[Logback]. It is accessed via JMX so <<jmx-bean-management, include Jolokia>> in your application. In addition you have configure Logback's `JMXConfigurator`:
[source,xml]
.logback-spring.xml
----
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<include resource="org/springframework/boot/logging/logback/base.xml"/>
<jmxConfigurator/>
</configuration>
----
NOTE: In case you are deploying multiple applications to the same JVM and multiple Logback-JMX-beans are present, the UI will select the JMXConfigurator with the context-name equals to your applications name. In this case you need to set the `contextName` in your logback-configuration.
[[spring-boot-admin-client]]
=== Spring Boot Admin Client ===
......@@ -78,7 +62,7 @@ TIP: There are plenty of properties to influence the way how the SBA Client regi
| spring.boot.admin.client.api-path
| Http-path of registration endpoint at your admin server.
| `"api/applications"`
| `"instances"`
| spring.boot.admin.client.username +
spring.boot.admin.client.password
......@@ -89,15 +73,15 @@ spring.boot.admin.client.password
| Interval for repeating the registration (in ms).
| `10,000`
| spring.boot.admin.connect-timeout
| spring.boot.admin.client.connect-timeout
| Connect timeout for the registration (in ms).
| `5,000`
| spring.boot.admin.read-timeout
| spring.boot.admin.client.read-timeout
| Read timeout for the registration (in ms).
| `5,000`
| spring.boot.admin.auto-registration
| 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.
| `true`
......
......@@ -4,6 +4,3 @@
Can I include spring-boot-admin into my business application?::
*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.
How do I customize the UI?::
You can only customize the UI by copying and modifying the source of `spring-boot-admin-ui` and adding your own module to your classpath.
......@@ -4,20 +4,22 @@
[[set-up-admin-server]]
=== Setting up Spring Boot Admin Server ===
First you need to setup your server. To do this just setup a simple boot project (using http://start.spring.io).
First you need to setup your server. To do this just setup a simple boot project (using http://start.spring.io). As 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:
+
[source,xml,subs="verbatim,attributes"]
.pom.xml
----
<dependencies>
<dependency>
<groupId>de.codecentric</groupId>
<artifactId>spring-boot-admin-starter-server</artifactId>
<version>{project-version}</version>
</dependency>
</dependencies>
<dependency>
<groupId>de.codecentric</groupId>
<artifactId>spring-boot-admin-starter-server</artifactId>
<version>{project-version}</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:
......@@ -36,7 +38,7 @@ public class SpringBootAdminApplication {
NOTE: If you want to setup the Spring Boot Admin Server via war-deployment in a servlet-container, please have a look at the https://github.com/codecentric/spring-boot-admin/blob/master/spring-boot-admin-samples/spring-boot-admin-sample-war/[spring-boot-admin-sample-war].
See also the https://github.com/codecentric/spring-boot-admin/tree/master/spring-boot-admin-samples/spring-boot-admin-sample/[spring-boot-admin-sample] project, which also adds security.
See also the https://github.com/codecentric/spring-boot-admin/tree/master/spring-boot-admin-samples/spring-boot-admin-sample-servlet/[spring-boot-admin-sample-servlet] project, which also adds security.
[[register-client-applications]]
=== Registering client applications ===
......@@ -46,7 +48,7 @@ To register your application at the SBA Server you can either include the SBA Cl
[[register-clients-via-spring-boot-admin]]
==== Spring Boot Admin Client ====
Each application that wants to register has to include the Spring Boot Admin Client.
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:
+
......@@ -58,6 +60,10 @@ Each application that wants to register has to include the Spring Boot Admin Cli
<artifactId>spring-boot-admin-starter-client</artifactId>
<version>{project-version}</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:
......@@ -65,18 +71,34 @@ Each application that wants to register has to include the Spring Boot Admin Cli
[source,yml]
.application.yml
----
spring.boot.admin.client.url: http://localhost:8080 #<1>
management.security.enabled: false #<2>
spring.boot.admin.client.url: "http://localhost:8080" #<1>
management.endpoints.web.exposure.include: "*" #<2>
----
<1> The URL of the Spring Boot Admin Server to register at.
<2> Since Spring Boot 1.5.x all endpoints are secured by default. For the sake of brevity we're disabling the security for now. Have a look at the <<securing-spring-boot-admin,security section>> on how to deal with secured endpoints.
<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.
. Make the actuator endpoints accessible:
+
[source,java]
----
@Configuration
public static class SecurityPermitAllConfig extends WebSecurityConfigurerAdapter {
@Override
protected void configure(HttpSecurity http) throws Exception {
http.authorizeRequests().anyRequest().permitAll() //<1>
.and().csrf().disable();
}
}
----
<1> For the sake of brevity we're disabling the security for now. Have a look at the <<securing-spring-boot-admin,security section>> on how to deal with secured endpoints.
[[discover-clients-via-spring-cloud-discovery]]
==== Spring Cloud Discovery ====
If you already use Spring Cloud Discovery for your applications you don't need the SBA Client. Just make the Spring Boot Admin Server a DiscoveryClient, the rest is done by our AutoConfiguration.
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 are for using Eureka, but other Spring Cloud Discovery implementations are supported as well. There are examples using https://github.com/codecentric/spring-boot-admin/tree/master/spring-boot-admin-samples/spring-boot-admin-sample-consul/[Consul] and https://github.com/codecentric/spring-boot-admin/tree/master/spring-boot-admin-samples/spring-boot-admin-sample-zookeeper/[Zookeeper].
The following steps uses Eureka, but other Spring Cloud Discovery implementations are supported as well. There are examples using https://github.com/codecentric/spring-boot-admin/tree/master/spring-boot-admin-samples/spring-boot-admin-sample-consul/[Consul] and https://github.com/codecentric/spring-boot-admin/tree/master/spring-boot-admin-samples/spring-boot-admin-sample-zookeeper/[Zookeeper].
Also have a look at the http://projects.spring.io/spring-cloud/spring-cloud.html[Spring Cloud documentation].
......@@ -94,6 +116,8 @@ include::{samples-dir}/spring-boot-admin-sample-eureka/pom.xml[tags=dependency-e
----
include::{samples-dir}/spring-boot-admin-sample-eureka/src/main/java/de/codecentric/boot/admin/SpringBootAdminApplication.java[tags=application-eureka]
----
<1> For the sake of brevity we're disabling the security for now. Have a look at the <<securing-spring-boot-admin,security section>> on how to deal with secured endpoints.
. Tell the Eureka client where to find the service registry:
+
......@@ -103,7 +127,7 @@ include::{samples-dir}/spring-boot-admin-sample-eureka/src/main/java/de/codecent
include::{samples-dir}/spring-boot-admin-sample-eureka/src/main/resources/application.yml[tags=configuration-eureka]
----
<1> Configuration section for the Eureka client
<2> Since Spring Boot 1.5.x all endpoints are secured by default. For the sake of brevity we're disabling the security for now. Have a look at the <<securing-spring-boot-admin,security section>> on how to deal with secured endpoints.
<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 https://github.com/codecentric/spring-boot-admin/tree/master/spring-boot-admin-samples/spring-boot-admin-sample-eureka/[spring-boot-admin-sample-eureka].
......
......@@ -27,4 +27,6 @@ include::server.adoc[]
include::security.adoc[]
include::changes-2.x.adoc[]
include::faqs.adoc[]
......@@ -6,7 +6,16 @@ The Spring Boot Admin Server can use Spring Clouds `DiscoveryClient` to discover
[[spring-cloud-discovery-static-config]]
==== SimpleDiscoveryClient configuration ====
Spring Boot Admin ships with the `SimpleDiscoveryClient` included. This allows you to specify client applications via configuration, without adding the SBA Client or a DiscoveryClient implementation to your monitored applications:
Spring Cloud provides a `SimpleDiscoveryClient`. It allows you to specify client applications via static configuration:
[source,xml]
.pom.xml
----
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter</artifactId>
</dependency>
----
[source,yml]
.application.yml
......
......@@ -38,9 +38,9 @@ public class NotifierConfiguration {
==== Filtering notifications ====
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 `api/notifications/filter` gets available. When this happens the ui shows options to manage the filters.
If you add a `FilteringNotifier` to your `ApplicationContext` a RESTful interface on `api/notifications/filter` gets available.
This notifier is useful if you don't want recieve notifications when deploying your applications. Before stopping the application you can add an (expiring) filter either via a `POST` request or the ui.
This notifier is useful if you don't want recieve notifications when deploying your applications. Before stopping the application you can add an (expiring) filter either via a `POST` request.
.How to configure filtering
[source,java]
......@@ -386,4 +386,4 @@ To enable https://telegram.org/[Telegram] notifications you need to create and a
| spring.boot.admin.notify.telegram.message
| Text to send. SpEL-expressions are supported.
| `+++"<strong>#{application.name}</strong>/#{application.id} is <strong>#{to.status}</strong>"+++`
|===
\ No newline at end of file
|===
=== UI Modules ===
Additional to the core UI there are following modules which can be included by adding the jar-file to the classpath:
- spring-boot-admin-server-ui-activiti
- spring-boot-admin-server-ui-hystrix
- spring-boot-admin-server-ui-turbine
==== Hystrix UI Module ====
The Hystrix module uses the hystrix-dashboard to display the metrics from Hystrix streams.
. Add the ui module to your classpath:
+
[source,xml,subs="verbatim,attributes"]
.pom.xml
----
<dependency>
<groupId>de.codecentric</groupId>
<artifactId>spring-boot-admin-server-ui-hystrix</artifactId>
<version>{project-version}</version>
</dependency>
----
. Add the `/hystrix.stream` to the proxified endpoints:
+
[source,yml]
.application.yml
----
include::{samples-dir}/spring-boot-admin-sample-eureka/src/main/resources/application.yml[tags=configuration-ui-hystrix]
----
==== Turbine UI Module ====
The Turbine module uses the hystrix-dashboard to display the metrics from a Turbine stream. The UI module does not configure Turbine for you. Either you run Turbine as a separate application or integrate it into your Spring Boot Admin application. Please see http://cloud.spring.io/spring-cloud-static/{spring-cloud-version}/#_turbine[Spring Cloud Reference] on setting up Turbine.
. Add the ui module to your classpath:
+
[source,xml,subs="verbatim,attributes"]
.pom.xml
----
<dependency>
<groupId>de.codecentric</groupId>
<artifactId>spring-boot-admin-server-ui-turbine</artifactId>
<version>{project-version}</version>
</dependency>
----
. Configure the Turbine server and clusters
+
[source,yml]
.application.yml
----
include::{samples-dir}/spring-boot-admin-sample-eureka/src/main/resources/application.yml[tags=configuration-ui-turbine]
----
<1> Configures the service with id `turbine` as Turbine server. URLs are also allowed.
.Turbine UI Module configuration options
|===
| Property name |Description |Default value
| spring.boot.admin.turbine.enabled
| Enable the Spring Boot Admin backend configuration for Turbine.
| `true`
| spring.boot.admin.turbine.location
| ServiceId or URL (without the `/turbine.stream` path) for the Turbine server. Must be reachable from admin server.
| `"turbine"`
| spring.boot.admin.turbine.clusters
| List of available Turbine clusters.
| `"default"`
|
|===
==== Activiti UI Module ====
The Activiti module shows information from the `/activiti` endpoint.
. Add the ui module to your classpath:
+
[source,xml,subs="verbatim,attributes"]
.pom.xml
----
<dependency>
<groupId>de.codecentric</groupId>
<artifactId>spring-boot-admin-server-ui-activiti</artifactId>
<version>{project-version}</version>
</dependency>
----
. Add the `/activiti` to the proxified endpoints:
+
[source,yml]
.application.yml
----
spring.boot.admin.routes.endpoints: env,metrics,dump,jolokia,info,configprops,trace,logfile,refresh,flyway,liquibase,heapdump,activiti
----
==== Login UI Module ====
The Login module just provides you a login page and a logout button.
. Add the ui module to your classpath:
+
[source,xml,subs="verbatim,attributes"]
.pom.xml
----
<dependency>
<groupId>de.codecentric</groupId>
<artifactId>spring-boot-admin-server-ui-login</artifactId>
<version>{project-version}</version>
</dependency>
----
......@@ -23,16 +23,21 @@
| spring.boot.admin.monitor.read-timeout
| Read timeout in ms when querying the applications' status and info.
| 5,000
| spring.boot.admin.routes.endpoints
| The enpoints which will be available via spring boot admin zuul proxy. If you write ui modules using other endpoints you need to add them.
| `"env", "metrics", "trace", "dump", "jolokia", "info", "configprops", "activiti", "logfile", "refresh", "flyway", "liquibase", "loggers"`
| 20,000
| spring.boot.admin.metadata-keys-to-sanitize
| Metadata values for the keys matching these regex patterns will be sanitized in all json output.
| `".*password$", ".*secret$", ".*key$", ".*$token$", ".*credentials.*", ".*vcap_services$"`
| 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)..
| `"health", "env", "metrics", "httptrace:trace", "threaddump:dump", "jolokia", "info", "logfile", "refresh", "flyway", "liquibase", "heapdump", "loggers", "auditevents"`
| spring.boot.admin.instance-proxy.ignored-headers
| Headers not to be forwarded when making requests to clients.
| `"Cookie", "Set-Cookie", "Authorization"
|===
include::server-discovery.adoc[]
......@@ -40,5 +45,3 @@ include::server-discovery.adoc[]
include::server-clustering.adoc[]
include::server-notifications.adoc[]
include::server-ui-modules.adoc[]
......@@ -63,6 +63,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>${maven-jar-plugin.version}</version>
<configuration>
<archive>
<manifest>
......
......@@ -39,7 +39,7 @@ public class SpringBootAdminApplication {
public static class SecurityPermitAllConfig extends WebSecurityConfigurerAdapter {
@Override
protected void configure(HttpSecurity http) throws Exception {
http.authorizeRequests().anyRequest().permitAll()//
http.authorizeRequests().anyRequest().permitAll() //<1>
.and().csrf().disable();
}
}
......
......@@ -3,20 +3,20 @@ spring:
name: eureka-example
# tag::configuration-eureka[]
eureka:
eureka: #1
instance:
leaseRenewalIntervalInSeconds: 10
client:
registryFetchIntervalSeconds: 5
serviceUrl:
defaultZone: ${EUREKA_SERVICE_URL:http://localhost:8761}/eureka/
# end::configuration-eureka[]
management:
endpoints:
web:
exposure:
include: "*"
include: "*" #2
# end::configuration-eureka[]
endpoint:
health:
show-details: ALWAYS
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment