Upload
nicolas-frankel
View
751
Download
1
Tags:
Embed Size (px)
Citation preview
Spring boot for devops
Nicolas Frankel@nicolas_frankel
Me, Myself and I
• Developer & Architect
– As Consultant
• Teacher/trainer
• Book Author
• Blogger
@nicolas_frankel
Working for hybris
@nicolas_frankel
DevOps
• Devs and Opscollaboration?
• Treat your infrastructure as code?
• Automate everything?
@nicolas_frankel
DevOps
• Monitoring
• Metrics
@nicolas_frankel
A little story
@nicolas_frankel
Non-Functional Requirements
• Monitoring
–Health checks
–Metrics
@nicolas_frankel
Non-Functional Requirements
• Configuration
– Beans
– Property values
– Controller mappings
– Etc.
@nicolas_frankel
Enough talk, time for a demo
@nicolas_frankel
Dropwizard Metrics
• A metrics model
• Exporters to backends
• And more…
@nicolas_frankel
Simple metrics
• Gauge
– Simple value
• Counter
– Incrementable gauge
@nicolas_frankel
Dropwizard reporters
• JMX
• Graphite
• (HTTP)
@nicolas_frankel
jconsole
• JMX-compliant GUI for monitoring JVM
@nicolas_frankel
@nicolas_frankel
Graphite
• Store numeric time-series data
• Render graphs of this data on demand
@nicolas_frankel
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
Metrics are not only technical
@nicolas_frankel
Health checks
• A good way to monitor your application
• Each check wraps a dependency
– e.g. a datasource
@nicolas_frankel
Health checks
• Each check returns an Health object
–Status UP or DOWN
– If not, possibly with details
@nicolas_frankel
Health check 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
Health check
• Bean must implementHealthIndicator
• Doesn’t use DropwizardHealthCheck
@nicolas_frankel
References
• Graphite Vagrant– https://github.com/tilmans/vagrant-statsd-graphite-
puppet
• Enhanced Spring Pet Clinic– https://github.com/nfrankel/enhanced-pet-clinic
@nicolas_frankel
Q&A
• @nicolas_frankel
• http://blog.frankel.ch/
• https://leanpub.com/integrationtest/
@nicolas_frankel