Upgrade to Pro — share decks privately, control downloads, hide ads and more …

How to keep your services available by monitoring its metrics

How to keep your services available by monitoring its metrics

It’s not a secret that microservices enhance many things in your project: including its complexity.

Imagine that beautiful picture: a lot of services stopping in domino, and you can’t figure out where it started, what happened, and who will be the next one to fail. Nightmare!

That’s why there are metrics and monitoring processes. They allow you to not be “reactive” (#jokealert). Instead, you can be prepared for anything.

Join us to understand how to use metrics to keep your services available and how it can be done by using MicroProfile.

Cad9d9d8998f49269ce4f28a018ba53e?s=128

Elder Moraes

October 02, 2019
Tweet

Transcript

  1. Copyright © 2019, Oracle and/or its affiliates. All rights reserved.

    | 2 How to keep your services available by monitoring its metrics Elder Moraes | @elderjava Developer Advocate October, 2019
  2. Copyright © 2019, Oracle and/or its affiliates. All rights reserved.

    | Safe Harbor Statement The following is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. The development, release, timing, and pricing of any features or functionality described for Oracle’s products may change and remains at the sole discretion of Oracle Corporation.
  3. Copyright © 2019, Oracle and/or its affiliates. All rights reserved.

    | 4
  4. Copyright © 2019, Oracle and/or its affiliates. All rights reserved.

    | Why microservices? 5
  5. Copyright © 2019, Oracle and/or its affiliates. All rights reserved.

    | –  M. Conway (Conway’s Law) 6 “Organizations which design systems (…) are constrained to produce designs which are copies of the communication structure of these organizations”
  6. Copyright © 2019, Oracle and/or its affiliates. All rights reserved.

    | 7 Two Pizzas Rule
  7. Copyright © 2019, Oracle and/or its affiliates. All rights reserved.

    | Microservices should first scale people, not software 8
  8. Copyright © 2019, Oracle and/or its affiliates. All rights reserved.

    | 9 https://martinfowler.com/articles/microservices.html
  9. Copyright © 2019, Oracle and/or its affiliates. All rights reserved.

    | 10 https://martinfowler.com/articles/microservices.html
  10. Copyright © 2019, Oracle and/or its affiliates. All rights reserved.

    | Why MicroProfile? 11
  11. Copyright © 2019, Oracle and/or its affiliates. All rights reserved.

    | 12
  12. Copyright © 2019, Oracle and/or its affiliates. All rights reserved.

    | Metrics 13
  13. Copyright © 2019, Oracle and/or its affiliates. All rights reserved.

    | Metric is any measure that you use to evaluate, to control and/or to select quantitatively: a person, a process, an event or an institution 14
  14. Copyright © 2019, Oracle and/or its affiliates. All rights reserved.

    | Metric vs Health Check 15
  15. Copyright © 2019, Oracle and/or its affiliates. All rights reserved.

    | RockyBalboaService 16
  16. Copyright © 2019, Oracle and/or its affiliates. All rights reserved.

    | 17 •  Punch power: 100% •  Bleeding: 0 ml/s •  Sight view: 100% •  Sweating: 1 ml/s •  Self confidence: 10 •  Speaking: Adrian! •  Punch power: 0,5% •  Bleeding: 100 ml/s •  Sight view: -10% •  Sweating: 2.000.000 ml/s (!!!) •  Self confidence: 0 •  Speaking: Ãnhãnãããnnnn
  17. Copyright © 2019, Oracle and/or its affiliates. All rights reserved.

    | Metrics & MicroProfile 18
  18. Copyright © 2019, Oracle and/or its affiliates. All rights reserved.

    | MicroProfile: 3 types of metrics •  base – JVM – Threads – Thread Pools – Classloading – SO •  vendor •  application 19
  19. Copyright © 2019, Oracle and/or its affiliates. All rights reserved.

    | 20 JSON PROMETHEUS REST API
  20. Copyright © 2019, Oracle and/or its affiliates. All rights reserved.

    | 21 REST API /metrics /metrics/base /metrics/vendor /metrics/application
  21. Copyright © 2019, Oracle and/or its affiliates. All rights reserved.

    | 22 Gauge JSON format
  22. Copyright © 2019, Oracle and/or its affiliates. All rights reserved.

    | 23 Counter JSON format
  23. Copyright © 2019, Oracle and/or its affiliates. All rights reserved.

    | 24 Meter JSON format
  24. Copyright © 2019, Oracle and/or its affiliates. All rights reserved.

    | 25 Histogram JSON format
  25. Copyright © 2019, Oracle and/or its affiliates. All rights reserved.

    | 26 Timer JSON format
  26. Copyright © 2019, Oracle and/or its affiliates. All rights reserved.

    | All formats have an equivalent for Prometheus 27
  27. Copyright © 2019, Oracle and/or its affiliates. All rights reserved.

    | Metrics oriented code 28
  28. Copyright © 2019, Oracle and/or its affiliates. All rights reserved.

    | 29 Annotation
  29. Copyright © 2019, Oracle and/or its affiliates. All rights reserved.

    | 30 Annotation Apply to Description @Counted M, C, T Counts the requests to the object @Gauge M Shows the object value @Metered M, C, T Measures the request frequency @Timed M, C, T Measures how much time the object lives (C=Constructor, M=Method, T=Type)
  30. Copyright © 2019, Oracle and/or its affiliates. All rights reserved.

    | Helidon 31
  31. Copyright © 2019, Oracle and/or its affiliates. All rights reserved.

    | •  It’s a set of APIs for microservices development using Java •  Open Source (Apache 2.0) •  Helidon SE: microframework •  Helidon MP: MicroProfile 32
  32. Copyright © 2019, Oracle and/or its affiliates. All rights reserved.

    | 33
  33. Copyright © 2019, Oracle and/or its affiliates. All rights reserved.

    | 34 Architecture
  34. Copyright © 2019, Oracle and/or its affiliates. All rights reserved.

    | 35 Helidon SE code
  35. Copyright © 2019, Oracle and/or its affiliates. All rights reserved.

    | 36 Helidon MP code
  36. Copyright © 2019, Oracle and/or its affiliates. All rights reserved.

    | DEMO TIME!!! 37
  37. Copyright © 2019, Oracle and/or its affiliates. All rights reserved.

    | @elderjava book.eldermoraes.com
  38. Copyright © 2019, Oracle and/or its affiliates. All rights reserved.

    | Java @ Cloud Age bit.ly/javacloudseries
  39. Copyright © 2019, Oracle and/or its affiliates. All rights reserved.

    | 40