30
SPRINGONE2GX WASHINGTON, DC Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under a Creative Commons Attribution-NonCommercial license: http://creativecommons.org/licenses/by-nc/3.0/ Spring Boot for DevOps Nicolas Fränkel @nicolas_frankel

Voxxed Days Ticino - Spring Boot for Devops

Embed Size (px)

Citation preview

Page 1: Voxxed Days Ticino - Spring Boot for Devops

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

Page 2: Voxxed Days Ticino - Spring Boot for Devops

@nicolas_frankel 2

Me, Myself and I• By day

– hybris consultant• By night

– Teacher/trainer– Blogger– Book author

Page 3: Voxxed Days Ticino - Spring Boot for Devops

@nicolas_frankel 3

DevOps• Devs and Ops collaboration?• Treat your infrastructure as

code?• Automate everything?

Page 4: Voxxed Days Ticino - Spring Boot for Devops

@nicolas_frankel 4

DevOps• Meta-data• Health checks• Metrics

Page 5: Voxxed Days Ticino - Spring Boot for Devops

@nicolas_frankel 5

A little story

Page 6: Voxxed Days Ticino - Spring Boot for Devops

@nicolas_frankel 6

Spring Boot to the rescue

Page 7: Voxxed Days Ticino - Spring Boot for Devops

@nicolas_frankel 7

Non-Functional Requirements• Meta data• Monitoring

– Health checks– Metrics

Page 8: Voxxed Days Ticino - Spring Boot for Devops

@nicolas_frankel 8

Non-Functional Requirements• Configuration

– Beans– Property values– Controller mappings– etc.

Page 9: Voxxed Days Ticino - Spring Boot for Devops

@nicolas_frankel 9

Enough talk, time for a demo

Page 10: Voxxed Days Ticino - Spring Boot for Devops

@nicolas_frankel 14

1. Meta data

Page 11: Voxxed Days Ticino - Spring Boot for Devops

@nicolas_frankel 15

Meta data• Which application?

– groupId– applicationId

• Version– From Maven– From Git

• Anything!!!

Page 12: Voxxed Days Ticino - Spring Boot for Devops

@nicolas_frankel 16

Demo time

Page 13: Voxxed Days Ticino - Spring Boot for Devops

@nicolas_frankel 17

2. Health checks

Page 14: Voxxed Days Ticino - Spring Boot for Devops

@nicolas_frankel 18

Health checks• A good way to monitor your

application• Each check wraps a

dependency• e.g. a datasource

Page 15: Voxxed Days Ticino - Spring Boot for Devops

@nicolas_frankel 19

Health checks• Each check returns an Health

object– Status

• UP • DOWN• UNKWOWN• OUT_OF_SERVICE

– Possibly with details

Page 16: Voxxed Days Ticino - Spring Boot for Devops

@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

Page 17: Voxxed Days Ticino - Spring Boot for Devops

@nicolas_frankel 21

Health checks• Bean must implement

HealthIndicator• Doesn’t use Dropwizard

HealthCheck

Page 18: Voxxed Days Ticino - Spring Boot for Devops

@nicolas_frankel 22

Demo time

Page 19: Voxxed Days Ticino - Spring Boot for Devops

@nicolas_frankel 23

3. Metrics

Page 20: Voxxed Days Ticino - Spring Boot for Devops

@nicolas_frankel 24

Dropwizard Metrics• A metrics model• Exporters to backends• And more…

Page 21: Voxxed Days Ticino - Spring Boot for Devops

@nicolas_frankel 25

Simple metrics• Gauge

– Simple value• Counter

– Incrementable gauge

Page 22: Voxxed Days Ticino - Spring Boot for Devops

@nicolas_frankel 26

jconsole• JMX-compliant GUI for

monitoring JVM

Page 23: Voxxed Days Ticino - Spring Boot for Devops

@nicolas_frankel 27

Page 24: Voxxed Days Ticino - Spring Boot for Devops

@nicolas_frankel 28

Demo time

Page 25: Voxxed Days Ticino - Spring Boot for Devops

@nicolas_frankel 29

Dropwizard reporters• (HTTP)• (JMX)• Graphite

Page 26: Voxxed Days Ticino - Spring Boot for Devops

@nicolas_frankel 32

Graphite• Store numeric time-series data• Render graphs of this data on

demand

Page 27: Voxxed Days Ticino - Spring Boot for Devops

@nicolas_frankel 33

Demo time

Page 28: Voxxed Days Ticino - Spring Boot for Devops

@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

Page 29: Voxxed Days Ticino - Spring Boot for Devops

@nicolas_frankel 37

Metrics are not only technical