Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Spring IO 2018 - Monitoring Spring Boot Applica...
Search
Johannes Edmeier
May 24, 2018
Programming
2
3k
Spring IO 2018 - Monitoring Spring Boot Applications with Spring Boot Admin
Johannes Edmeier
May 24, 2018
Tweet
Share
More Decks by Johannes Edmeier
See All by Johannes Edmeier
Java User Group - Spring Boot Admin
joshiste
0
230
Other Decks in Programming
See All in Programming
[JAWS-UG横浜 #79] re:Invent 2024 の DB アップデートは Multi-Region!
maroon1st
1
140
CNCF Project の作者が考えている OSS の運営
utam0k
5
690
XStateを用いた堅牢なReact Components設計~複雑なClient Stateをシンプルに~ @React Tokyo ミートアップ #2
kfurusho
1
770
自分ひとりから始められる生産性向上の取り組み #でぃーぷらすオオサカ
irof
8
2.6k
chibiccをCILに移植した結果 (NGK2025S版)
kekyo
PRO
0
210
Amazon Q Developer Proで効率化するAPI開発入門
seike460
PRO
0
110
2,500万ユーザーを支えるSREチームの6年間のスクラムのカイゼン
honmarkhunt
6
5.1k
Multi Step Form, Decentralized Autonomous Organization
pumpkiinbell
1
660
Conform を推す - Advocating for Conform
mizoguchicoji
3
680
テストをしないQAエンジニアは何をしているか?
nealle
0
130
Pulsar2 を雰囲気で使ってみよう
anoken
0
230
Rails アプリ地図考 Flush Cut
makicamel
1
110
Featured
See All Featured
The Invisible Side of Design
smashingmag
299
50k
The Power of CSS Pseudo Elements
geoffreycrofte
75
5.5k
Fireside Chat
paigeccino
34
3.2k
4 Signs Your Business is Dying
shpigford
182
22k
Designing on Purpose - Digital PM Summit 2013
jponch
117
7.1k
The Art of Programming - Codeland 2020
erikaheidi
53
13k
How STYLIGHT went responsive
nonsquared
98
5.3k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
99
18k
Designing Experiences People Love
moore
139
23k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.1k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
193
16k
The World Runs on Bad Software
bkeepers
PRO
67
11k
Transcript
Spring Boot Admin 1 Johannes Edmeier @joshiste
2
Setting things up (demo time) 3
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 -
5 Setting up the SBA Server (2) @EnableAdminServer @SpringBootApplication public
class AdminServerApplication { ... } 2. Import Configuration to the Application
6 Register client applications (1) <dependency> <groupId>de.codecentric</groupId> <artifactId>spring-boot-admin-starter-client</artifactId> <version>2.0.0</version> </dependency>
1. Add dependency
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
8 Easy client tweaks spring.application.name=spring-petclinic logging.file=target/petclinic.log info.sources=https://github.com/spring-projects/spring-petclinic <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId>
<executions> <execution> <goals> <goal>build-info</goal> </goals> </execution> </executions> </plugin>
9 alternatively use Eureka, Consul, Zookeeper, static config … or
any other Spring Cloud Discovery Client Register client applications
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)
Behind the Scenes 11
12 SBA Client SBA Server client registers periodically via http
post
13 SBA Client SBA Server server polls health endpoint via
http … monitoring non-Boot applications is possible (just health checking)
14 Notifications HipChat eMail … or implement your own …
simply configured via properties
15 SBA Client server forwards requests to clients (using zuul)
SBA UI SBA Server … clients must expose actuator endpoints using http
16 … can be implemented using Spring Security e.g. Basic
Auth, JWT, session based, … … custom headers can be injected implementing a HttpHeadersProvider Security
17 Customization – HttpHeadersProvider @Bean public HttpHeadersProvider injectHeaders() { return
instance -> { HttpHeaders headers = new HttpHeaders() headers.set("X-CUSTOM", "1234567"); return headers; }; }
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); }; }
19 Customization - Notifier @Bean public Notifier loggerNotifier() { return
event -> { log.info("Event {}", event.toString()); return Mono.empty(); }; }
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
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
22 Questions? [spring-boot-admin] codecentric/spring-boot-admin GITTER codecentric/spring-boot-admin