Slide 1

Slide 1 text

Spring Boot Admin 1 Johannes Edmeier @joshiste

Slide 2

Slide 2 text

2

Slide 3

Slide 3 text

Setting things up (demo time) 3

Slide 4

Slide 4 text

4 Setting up the SBA Server (1) 1. Generate web project using Spring Initializr $ curl https://start.spring.io/starter.tgz \ -d dependencies=web,\ codecentric-spring-boot-admin-client,\ codecentric-spring-boot-admin-server \ | tar -xzvf -

Slide 5

Slide 5 text

5 Setting up the SBA Server (2) @EnableAdminServer @SpringBootApplication public class AdminServerApplication { ... } 2. Import Configuration to the Application

Slide 6

Slide 6 text

6 Register client applications (1) de.codecentric spring-boot-admin-starter-client 2.0.0 1. Add dependency

Slide 7

Slide 7 text

7 Register client applications (2) spring.boot.admin.client.url=http://localhost:8081 management.endpoints.web.exposure.include=* management.endpoint.health.show-details=always 2. Configure SBA Server localtion and expose endpoints

Slide 8

Slide 8 text

8 Easy client tweaks spring.application.name=spring-petclinic logging.file=target/petclinic.log info.sources=https://github.com/spring-projects/spring-petclinic org.springframework.boot spring-boot-maven-plugin build-info

Slide 9

Slide 9 text

9 alternatively use Eureka, Consul, Zookeeper, static config … or any other Spring Cloud Discovery Client Register client applications

Slide 10

Slide 10 text

10 alternatively use Eureka, Consul, Zookeeper, static config … or any other Spring Cloud Discovery Client Register client applications Postponed to 2.0.1 (snapshot available)

Slide 11

Slide 11 text

Behind the Scenes 11

Slide 12

Slide 12 text

12 SBA Client SBA Server client registers periodically via http post

Slide 13

Slide 13 text

13 SBA Client SBA Server server polls health endpoint via http … monitoring non-Boot applications is possible (just health checking)

Slide 14

Slide 14 text

14 Notifications HipChat eMail … or implement your own … simply configured via properties

Slide 15

Slide 15 text

15 SBA Client server forwards requests to clients (using zuul) SBA UI SBA Server … clients must expose actuator endpoints using http

Slide 16

Slide 16 text

16 … can be implemented using Spring Security e.g. Basic Auth, JWT, session based, … … custom headers can be injected implementing a HttpHeadersProvider Security

Slide 17

Slide 17 text

17 Customization – HttpHeadersProvider @Bean public HttpHeadersProvider injectHeaders() { return instance -> { HttpHeaders headers = new HttpHeaders() headers.set("X-CUSTOM", "1234567"); return headers; }; }

Slide 18

Slide 18 text

18 Customization - InstanceExchangeFilterFunction @Bean public InstanceExchangeFilterFunction auditLog() { return (instance, request, next) -> { if (HttpMethod.POST.equals(request.method())) { log.info("{} for {} on {}", request.method(), instance.getId(), request.url()); } return next.exchange(request); }; }

Slide 19

Slide 19 text

19 Customization - Notifier @Bean public Notifier loggerNotifier() { return event -> { log.info("Event {}", event.toString()); return Mono.empty(); }; }

Slide 20

Slide 20 text

20 Webflux Support Out of the Box Cloudfoundry Support Html-Templates for Mail-Notifications Version is also looked up in Metadata Sessions Endpoint Support Wallboard View Runs on Java 10 New Features in 2.0

Slide 21

Slide 21 text

21 Bugfixes… Bugfixes… Bugfixes… Spring Cloud Finchley Support Custom Views (for Custom Actuator Endpoints) Multi-Instances-Actions (e.g. Setting Loglevels) . . . What to Expect in the Future

Slide 22

Slide 22 text

22 Questions? [spring-boot-admin] codecentric/spring-boot-admin GITTER codecentric/spring-boot-admin