34
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

SpringOne 2GX - Spring Boot for Devops

Embed Size (px)

Citation preview

Page 1: SpringOne 2GX  - 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: SpringOne 2GX  - Spring Boot for Devops

Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under aCreative Commons Attribution-NonCommercial license: http://creativecommons.org/l icenses/by-nc/3.0/ 2

Pardon my French…

Page 3: SpringOne 2GX  - Spring Boot for Devops

Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under aCreative Commons Attribution-NonCommercial license: http://creativecommons.org/l icenses/by-nc/3.0/ 3

Those don’t go well together

Page 4: SpringOne 2GX  - Spring Boot for Devops

Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under aCreative Commons Attribution-NonCommercial license: http://creativecommons.org/l icenses/by-nc/3.0/

Me, Myself and I• Developer & Architect

– As Consultant• Teacher/trainer• Blogger

Page 5: SpringOne 2GX  - Spring Boot for Devops

Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under aCreative Commons Attribution-NonCommercial license: http://creativecommons.org/l icenses/by-nc/3.0/ 5

hybris, an SAP company

Page 6: SpringOne 2GX  - Spring Boot for Devops

Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under aCreative Commons Attribution-NonCommercial license: http://creativecommons.org/l icenses/by-nc/3.0/ 6

Shameless self-promotion

Page 7: SpringOne 2GX  - Spring Boot for Devops

Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under aCreative Commons Attribution-NonCommercial license: http://creativecommons.org/l icenses/by-nc/3.0/

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

code?• Automate everything?

Page 8: SpringOne 2GX  - Spring Boot for Devops

Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under aCreative Commons Attribution-NonCommercial license: http://creativecommons.org/l icenses/by-nc/3.0/

DevOps• Meta-data• Health checks• Metrics

Page 9: SpringOne 2GX  - Spring Boot for Devops

Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under aCreative Commons Attribution-NonCommercial license: http://creativecommons.org/l icenses/by-nc/3.0/

A little story

Page 10: SpringOne 2GX  - Spring Boot for Devops

Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under aCreative Commons Attribution-NonCommercial license: http://creativecommons.org/l icenses/by-nc/3.0/ 10

Spring Boot to the rescue

Page 11: SpringOne 2GX  - Spring Boot for Devops

Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under aCreative Commons Attribution-NonCommercial license: http://creativecommons.org/l icenses/by-nc/3.0/

Non-Functional Requirements• Meta data• Monitoring

– Health checks– Metrics

Page 12: SpringOne 2GX  - Spring Boot for Devops

Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under aCreative Commons Attribution-NonCommercial license: http://creativecommons.org/l icenses/by-nc/3.0/

Non-Functional Requirements• Configuration

– Beans– Property values– Controller mappings– etc.

Page 13: SpringOne 2GX  - Spring Boot for Devops

Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under aCreative Commons Attribution-NonCommercial license: http://creativecommons.org/l icenses/by-nc/3.0/

Enough talk, time for a demo

Page 14: SpringOne 2GX  - Spring Boot for Devops

Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under aCreative Commons Attribution-NonCommercial license: http://creativecommons.org/l icenses/by-nc/3.0/ 18

1. Meta data

Page 15: SpringOne 2GX  - Spring Boot for Devops

Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under aCreative Commons Attribution-NonCommercial license: http://creativecommons.org/l icenses/by-nc/3.0/ 19

Meta data• Which application?

– groupId– applicationId

• Version– From Maven– From Git

• Anything!!!

Page 16: SpringOne 2GX  - Spring Boot for Devops

Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under aCreative Commons Attribution-NonCommercial license: http://creativecommons.org/l icenses/by-nc/3.0/

Demo time

Page 17: SpringOne 2GX  - Spring Boot for Devops

Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under aCreative Commons Attribution-NonCommercial license: http://creativecommons.org/l icenses/by-nc/3.0/ 21

2. Health checks

Page 18: SpringOne 2GX  - Spring Boot for Devops

Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under aCreative Commons Attribution-NonCommercial license: http://creativecommons.org/l icenses/by-nc/3.0/

Health checks• A good way to monitor your

application• Each check wraps a

dependency• e.g. a datasource

Page 19: SpringOne 2GX  - Spring Boot for Devops

Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under aCreative Commons Attribution-NonCommercial license: http://creativecommons.org/l icenses/by-nc/3.0/

Health checks• Each check returns an Health

object– Status

• UP • DOWN• UNKWOWN• OUT_OF_SERVICE

– Possibly with details

Page 20: SpringOne 2GX  - Spring Boot for Devops

Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under aCreative Commons Attribution-NonCommercial license: http://creativecommons.org/l icenses/by-nc/3.0/

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 21: SpringOne 2GX  - Spring Boot for Devops

Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under aCreative Commons Attribution-NonCommercial license: http://creativecommons.org/l icenses/by-nc/3.0/

Health checks• Bean must implement

HealthIndicator• Doesn’t use Dropwizard

HealthCheck

Page 22: SpringOne 2GX  - Spring Boot for Devops

Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under aCreative Commons Attribution-NonCommercial license: http://creativecommons.org/l icenses/by-nc/3.0/

Demo time

Page 23: SpringOne 2GX  - Spring Boot for Devops

Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under aCreative Commons Attribution-NonCommercial license: http://creativecommons.org/l icenses/by-nc/3.0/ 27

3. Metrics

Page 24: SpringOne 2GX  - Spring Boot for Devops

Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under aCreative Commons Attribution-NonCommercial license: http://creativecommons.org/l icenses/by-nc/3.0/

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

Page 25: SpringOne 2GX  - Spring Boot for Devops

Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under aCreative Commons Attribution-NonCommercial license: http://creativecommons.org/l icenses/by-nc/3.0/

Simple metrics• Gauge

– Simple value• Counter

– Incrementable gauge

Page 26: SpringOne 2GX  - Spring Boot for Devops

Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under aCreative Commons Attribution-NonCommercial license: http://creativecommons.org/l icenses/by-nc/3.0/

Dropwizard reporters• JMX• Graphite• (HTTP)

Page 27: SpringOne 2GX  - Spring Boot for Devops

Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under aCreative Commons Attribution-NonCommercial license: http://creativecommons.org/l icenses/by-nc/3.0/

jconsole• JMX-compliant GUI for

monitoring JVM

Page 28: SpringOne 2GX  - Spring Boot for Devops

Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under aCreative Commons Attribution-NonCommercial license: http://creativecommons.org/l icenses/by-nc/3.0/

Page 29: SpringOne 2GX  - Spring Boot for Devops

Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under aCreative Commons Attribution-NonCommercial license: http://creativecommons.org/l icenses/by-nc/3.0/

Demo time

Page 30: SpringOne 2GX  - Spring Boot for Devops

Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under aCreative Commons Attribution-NonCommercial license: http://creativecommons.org/l icenses/by-nc/3.0/

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

demand

Page 31: SpringOne 2GX  - Spring Boot for Devops

Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under aCreative Commons Attribution-NonCommercial license: http://creativecommons.org/l icenses/by-nc/3.0/

For development• Either define the 2 reporters

– Set @ConditionalOnMissingBean

– Use a "Development" profile• Or define only the JMX reporter

– In production, use JMXTrans

Page 32: SpringOne 2GX  - Spring Boot for Devops

Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under aCreative Commons Attribution-NonCommercial license: http://creativecommons.org/l icenses/by-nc/3.0/

Metrics are not only technical

Page 34: SpringOne 2GX  - Spring Boot for Devops

Unless otherwise indicated, these slides are © 2013-2015 Pivotal Software, Inc. and licensed under aCreative Commons Attribution-NonCommercial license: http://creativecommons.org/l icenses/by-nc/3.0/ 42

Spring Boot for DevOps

Learn More. Stay Connected.

@springcentral Spring.io/video