23
Spring boot for devops Nicolas Frankel @nicolas_frankel

Spring IO - Spring Boot for DevOps

Embed Size (px)

Citation preview

Page 1: Spring IO - Spring Boot for DevOps

Spring boot for devops

Nicolas Frankel@nicolas_frankel

Page 2: Spring IO - Spring Boot for DevOps

Me, Myself and I

• Developer & Architect

– As Consultant

• Teacher/trainer

• Book Author

• Blogger

@nicolas_frankel

Page 3: Spring IO - Spring Boot for DevOps

Working for hybris

@nicolas_frankel

Page 4: Spring IO - Spring Boot for DevOps

DevOps

• Devs and Opscollaboration?

• Treat your infrastructure as code?

• Automate everything?

@nicolas_frankel

Page 5: Spring IO - Spring Boot for DevOps

DevOps

• Monitoring

• Metrics

@nicolas_frankel

Page 6: Spring IO - Spring Boot for DevOps

A little story

@nicolas_frankel

Page 7: Spring IO - Spring Boot for DevOps

Non-Functional Requirements

• Monitoring

–Health checks

–Metrics

@nicolas_frankel

Page 8: Spring IO - Spring Boot for DevOps

Non-Functional Requirements

• Configuration

– Beans

– Property values

– Controller mappings

– Etc.

@nicolas_frankel

Page 9: Spring IO - Spring Boot for DevOps

Enough talk, time for a demo

@nicolas_frankel

Page 10: Spring IO - Spring Boot for DevOps

Dropwizard Metrics

• A metrics model

• Exporters to backends

• And more…

@nicolas_frankel

Page 11: Spring IO - Spring Boot for DevOps

Simple metrics

• Gauge

– Simple value

• Counter

– Incrementable gauge

@nicolas_frankel

Page 12: Spring IO - Spring Boot for DevOps

Dropwizard reporters

• JMX

• Graphite

• (HTTP)

@nicolas_frankel

Page 13: Spring IO - Spring Boot for DevOps

jconsole

• JMX-compliant GUI for monitoring JVM

@nicolas_frankel

Page 14: Spring IO - Spring Boot for DevOps

@nicolas_frankel

Page 15: Spring IO - Spring Boot for DevOps

Graphite

• Store numeric time-series data

• Render graphs of this data on demand

@nicolas_frankel

Page 16: Spring IO - Spring Boot for DevOps

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

Metrics are not only technical

@nicolas_frankel

Page 18: Spring IO - Spring Boot for DevOps

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

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

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

Health check

• Bean must implementHealthIndicator

• Doesn’t use DropwizardHealthCheck

@nicolas_frankel

Page 22: Spring IO - Spring Boot for DevOps

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

Q&A

• @nicolas_frankel

• http://blog.frankel.ch/

• https://leanpub.com/integrationtest/

@nicolas_frankel