Spring IO - Spring Boot for DevOps
-
Upload
nicolas-frankel -
Category
Software
-
view
754 -
download
1
Transcript of Spring IO - Spring Boot for DevOps
![Page 1: Spring IO - Spring Boot for DevOps](https://reader031.fdocuments.us/reader031/viewer/2022013108/55a645c21a28abed148b46b0/html5/thumbnails/1.jpg)
Spring boot for devops
Nicolas Frankel@nicolas_frankel
![Page 2: Spring IO - Spring Boot for DevOps](https://reader031.fdocuments.us/reader031/viewer/2022013108/55a645c21a28abed148b46b0/html5/thumbnails/2.jpg)
Me, Myself and I
• Developer & Architect
– As Consultant
• Teacher/trainer
• Book Author
• Blogger
@nicolas_frankel
![Page 3: Spring IO - Spring Boot for DevOps](https://reader031.fdocuments.us/reader031/viewer/2022013108/55a645c21a28abed148b46b0/html5/thumbnails/3.jpg)
Working for hybris
@nicolas_frankel
![Page 4: Spring IO - Spring Boot for DevOps](https://reader031.fdocuments.us/reader031/viewer/2022013108/55a645c21a28abed148b46b0/html5/thumbnails/4.jpg)
DevOps
• Devs and Opscollaboration?
• Treat your infrastructure as code?
• Automate everything?
@nicolas_frankel
![Page 5: Spring IO - Spring Boot for DevOps](https://reader031.fdocuments.us/reader031/viewer/2022013108/55a645c21a28abed148b46b0/html5/thumbnails/5.jpg)
DevOps
• Monitoring
• Metrics
@nicolas_frankel
![Page 6: Spring IO - Spring Boot for DevOps](https://reader031.fdocuments.us/reader031/viewer/2022013108/55a645c21a28abed148b46b0/html5/thumbnails/6.jpg)
A little story
@nicolas_frankel
![Page 7: Spring IO - Spring Boot for DevOps](https://reader031.fdocuments.us/reader031/viewer/2022013108/55a645c21a28abed148b46b0/html5/thumbnails/7.jpg)
Non-Functional Requirements
• Monitoring
–Health checks
–Metrics
@nicolas_frankel
![Page 8: Spring IO - Spring Boot for DevOps](https://reader031.fdocuments.us/reader031/viewer/2022013108/55a645c21a28abed148b46b0/html5/thumbnails/8.jpg)
Non-Functional Requirements
• Configuration
– Beans
– Property values
– Controller mappings
– Etc.
@nicolas_frankel
![Page 9: Spring IO - Spring Boot for DevOps](https://reader031.fdocuments.us/reader031/viewer/2022013108/55a645c21a28abed148b46b0/html5/thumbnails/9.jpg)
Enough talk, time for a demo
@nicolas_frankel
![Page 10: Spring IO - Spring Boot for DevOps](https://reader031.fdocuments.us/reader031/viewer/2022013108/55a645c21a28abed148b46b0/html5/thumbnails/10.jpg)
Dropwizard Metrics
• A metrics model
• Exporters to backends
• And more…
@nicolas_frankel
![Page 11: Spring IO - Spring Boot for DevOps](https://reader031.fdocuments.us/reader031/viewer/2022013108/55a645c21a28abed148b46b0/html5/thumbnails/11.jpg)
Simple metrics
• Gauge
– Simple value
• Counter
– Incrementable gauge
@nicolas_frankel
![Page 12: Spring IO - Spring Boot for DevOps](https://reader031.fdocuments.us/reader031/viewer/2022013108/55a645c21a28abed148b46b0/html5/thumbnails/12.jpg)
Dropwizard reporters
• JMX
• Graphite
• (HTTP)
@nicolas_frankel
![Page 13: Spring IO - Spring Boot for DevOps](https://reader031.fdocuments.us/reader031/viewer/2022013108/55a645c21a28abed148b46b0/html5/thumbnails/13.jpg)
jconsole
• JMX-compliant GUI for monitoring JVM
@nicolas_frankel
![Page 14: Spring IO - Spring Boot for DevOps](https://reader031.fdocuments.us/reader031/viewer/2022013108/55a645c21a28abed148b46b0/html5/thumbnails/14.jpg)
@nicolas_frankel
![Page 15: Spring IO - Spring Boot for DevOps](https://reader031.fdocuments.us/reader031/viewer/2022013108/55a645c21a28abed148b46b0/html5/thumbnails/15.jpg)
Graphite
• Store numeric time-series data
• Render graphs of this data on demand
@nicolas_frankel
![Page 16: Spring IO - Spring Boot for DevOps](https://reader031.fdocuments.us/reader031/viewer/2022013108/55a645c21a28abed148b46b0/html5/thumbnails/16.jpg)
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
![Page 17: Spring IO - Spring Boot for DevOps](https://reader031.fdocuments.us/reader031/viewer/2022013108/55a645c21a28abed148b46b0/html5/thumbnails/17.jpg)
Metrics are not only technical
@nicolas_frankel
![Page 18: Spring IO - Spring Boot for DevOps](https://reader031.fdocuments.us/reader031/viewer/2022013108/55a645c21a28abed148b46b0/html5/thumbnails/18.jpg)
Health checks
• A good way to monitor your application
• Each check wraps a dependency
– e.g. a datasource
@nicolas_frankel
![Page 19: Spring IO - Spring Boot for DevOps](https://reader031.fdocuments.us/reader031/viewer/2022013108/55a645c21a28abed148b46b0/html5/thumbnails/19.jpg)
Health checks
• Each check returns an Health object
–Status UP or DOWN
– If not, possibly with details
@nicolas_frankel
![Page 20: Spring IO - Spring Boot for DevOps](https://reader031.fdocuments.us/reader031/viewer/2022013108/55a645c21a28abed148b46b0/html5/thumbnails/20.jpg)
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
![Page 21: Spring IO - Spring Boot for DevOps](https://reader031.fdocuments.us/reader031/viewer/2022013108/55a645c21a28abed148b46b0/html5/thumbnails/21.jpg)
Health check
• Bean must implementHealthIndicator
• Doesn’t use DropwizardHealthCheck
@nicolas_frankel
![Page 22: Spring IO - Spring Boot for DevOps](https://reader031.fdocuments.us/reader031/viewer/2022013108/55a645c21a28abed148b46b0/html5/thumbnails/22.jpg)
References
• Graphite Vagrant– https://github.com/tilmans/vagrant-statsd-graphite-
puppet
• Enhanced Spring Pet Clinic– https://github.com/nfrankel/enhanced-pet-clinic
@nicolas_frankel
![Page 23: Spring IO - Spring Boot for DevOps](https://reader031.fdocuments.us/reader031/viewer/2022013108/55a645c21a28abed148b46b0/html5/thumbnails/23.jpg)
Q&A
• @nicolas_frankel
• http://blog.frankel.ch/
• https://leanpub.com/integrationtest/
@nicolas_frankel