Upload
nicolas-frankel
View
667
Download
0
Embed Size (px)
Citation preview
SPRINGONE2GXWASHINGTON, DC
Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and l icensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/l icenses/by-nc/3.0/
Spring Boot for DevOpsNicolas Fränkel
@nicolas_frankel
@nicolas_frankel 2
Me, Myself and I• By day
– hybris consultant• By night
– Teacher/trainer– Blogger– Book author
@nicolas_frankel 3
DevOps• Devs and Ops collaboration?• Treat your infrastructure as
code?• Automate everything?
@nicolas_frankel 4
DevOps• Meta-data• Health checks• Metrics
@nicolas_frankel 5
A little story
@nicolas_frankel 6
Spring Boot to the rescue
@nicolas_frankel 7
Non-Functional Requirements• Meta data• Monitoring
– Health checks– Metrics
@nicolas_frankel 8
Non-Functional Requirements• Configuration
– Beans– Property values– Controller mappings– etc.
@nicolas_frankel 9
Enough talk, time for a demo
@nicolas_frankel 14
1. Meta data
@nicolas_frankel 15
Meta data• Which application?
– groupId– applicationId
• Version– From Maven– From Git
• Anything!!!
@nicolas_frankel 16
Demo time
@nicolas_frankel 17
2. Health checks
@nicolas_frankel 18
Health checks• A good way to monitor your
application• Each check wraps a
dependency• e.g. a datasource
@nicolas_frankel 19
Health checks• Each check returns an Health
object– Status
• UP • DOWN• UNKWOWN• OUT_OF_SERVICE
– Possibly with details
@nicolas_frankel 20
Health checks endpoint• /health aggregates all checks• Health are objects
– Serialized in JSON• If only one is down, the HTTP
code is set to 5xx
@nicolas_frankel 21
Health checks• Bean must implement
HealthIndicator• Doesn’t use Dropwizard
HealthCheck
@nicolas_frankel 22
Demo time
@nicolas_frankel 23
3. Metrics
@nicolas_frankel 24
Dropwizard Metrics• A metrics model• Exporters to backends• And more…
@nicolas_frankel 25
Simple metrics• Gauge
– Simple value• Counter
– Incrementable gauge
@nicolas_frankel 26
jconsole• JMX-compliant GUI for
monitoring JVM
@nicolas_frankel 27
@nicolas_frankel 28
Demo time
@nicolas_frankel 29
Dropwizard reporters• (HTTP)• (JMX)• Graphite
@nicolas_frankel 32
Graphite• Store numeric time-series data• Render graphs of this data on
demand
@nicolas_frankel 33
Demo time
@nicolas_frankel 36
For development• Either define the 2 reporters
– Set @ConditionalOnMissingBean
– Use a "Development" profile• Or define only the JMX reporter
– In production, use JMXTrans
@nicolas_frankel 37
Metrics are not only technical
@nicolas_frankel 38
Q&Ahttps://github.com/nfrankel/enhanced-pet-clinic@nicolas_frankel http://frankel.in/http://blog.frankel.ch/