Diese Präsentation wurde erfolgreich gemeldet.
Wir verwenden Ihre LinkedIn Profilangaben und Informationen zu Ihren Aktivitäten, um Anzeigen zu personalisieren und Ihnen relevantere Inhalte anzuzeigen. Sie können Ihre Anzeigeneinstellungen jederzeit ändern.

Welcome to the Metrics

173 Aufrufe

Veröffentlicht am

SpringOne 2020
Welcome to the Metrics

Didier Burkhalter, Senior Platform Architect at VMware
Alexandre Roman, Solution Engineer at VMware

Veröffentlicht in: Software
  • Als Erste(r) kommentieren

Welcome to the Metrics

  1. 1. Welcome to the Metrics September 2–3, 2020 springone.io 1 #springone@springone
  2. 2. @didierDIB @Alexandre_Roman Welcome to this session! 2 Didier Burkhalter Solution Engineer, VMware @didierDIB Alexandre Roman Solution Engineer, VMware @Alexandre_Roman
  3. 3. @didierDIB @Alexandre_Roman Agenda Observability 101 What, why, how? Failure is the new normal Brace yourself, failure is coming Less is more Build better metrics 3 Questions? Use SpringOne Slack channel #session-welcome-to-the-metrics
  4. 4. Observability 101 What, why, how ?
  5. 5. @didierDIB @Alexandre_Roman Observability, one (academic) definition, upon others A measurable characteristic of a system that enables it to be “seen” (i.e., observed) such that its internal state and behavior can be inferred from external interrogation. The ability to query a system to discover insights and understanding. 5 Observability lays the critical foundation: ➔ for Reliability Engineering practices, ➔ providing a human-centered, data-informed approach ➔ to making informed decisions and strategic investments as learning organizations. “How well do I understand the state of this system right now?”
  6. 6. @didierDIB @Alexandre_Roman Observability goals 6 Understand, meet & adapt to business intents & needs (graal) (make) Effective & happier System Reliability Engineers & all operation folks Provide Stable, performant, adaptive systems, cost effective systems & operating models Customer centricity
  7. 7. @didierDIB @Alexandre_Roman Observability - the WHAT 7 Relationship based on “System Value domains” & three pillars Metrics Observables produce information Traces Observers consume “data” Logs Observability is based on shared “contracts” / “instruments” / “semantics” (or supposed to) The big (mis) Stakes : - Semantics misalignment between producers and consumers - “Asymmetric“ / “asynchronous” relationships This leads to wrong data interpretation and project latency
  8. 8. @didierDIB @Alexandre_Roman Observability - the HOW 8 Metrics Observable’s Systems produce information Traces Observer’s consume “data” Logs Observability tools Collect Process, interpret & transform, filter Display Alert Analytics, get Trends, Machine Learning Store Fix Scale Observer’s consume “data” Observers consume “data” Observable’s Systems produce information Observables Systems produce information Tension on Observability “cardinality” “Act” & “ReAct”
  9. 9. @didierDIB @Alexandre_Roman Observability - HOW & WHO 9 Observables Systems produce information Observers consume “data” and act Analytics >> put better & better perspectives on metrics, in dynamic situations SLI’s Svc level Indicators Bridge & bring shared sense to “metrics + dashboard” Based on SRE practices Collaborate, modelize, experiment, iterate, adapt, analyse Human designed, no knowledge on consumers To meet business intents, in efficient, secure and cost effective ways on Service Level’s contracts SLO’s Svc level Objectives Human designed, need help from product team (ideally) Shared contracts
  10. 10. You build it, you run it You measure it !
  11. 11. @didierDIB @Alexandre_Roman How do you drive your business ? 11 OR+ Scrape metrics from your apps and your platforms ★ Make sure the meaning of each metric is well understood by everyone Use meaningful metrics ★ Ask yourself: what are the key metrics you need to monitor your business?
  12. 12. @didierDIB @Alexandre_Roman Observability instantiation, for every body, at any time 12 Benefits for Dev’s and Operation ( wealth & multiplicity ) 12 CI/CD Run Dev / DevOps practices Design / Dev / Build Manage SRE practicesBridges with shared Semantic / communication / collaboration Machine Learning, Analytics, Trends Observe
  13. 13. @didierDIB @Alexandre_Roman 13 See Everything, Move Fast “Software Developer” Platform Services | Applications Developer Abstractions IaaS | CaaS | PaaS DATACENTER Virtualized Infrastructure Physical Infrastructure Platform / DevOps Infrastructure Ops AppDev “The Business” Customer Experience External Influences / Data Sources Speed / Effectiveness
  14. 14. Demo Monitor your app with a 360° dashboard
  15. 15. @didierDIB @Alexandre_Roman DATACENTER 15 Developer Abstractions IaaS | CaaS | PaaS “Software Developer” Platform Services | Applications Virtualized Infrastructure Physical Infrastructure “The Business” Customer Purchases Collect Visualize Normalize Correlate Find Platform / DevOps Infrastructure Ops AppDev See Everything, Move Fast
  16. 16. Failure is the new normal Brace yourself, failure is coming
  17. 17. @didierDIB @Alexandre_Roman We live in a distributed world 17 My app Business domain B Business domain A Cross-cutting domain We used to have a monolithic app: a single process where all business code is running as a single unit but We all know that scaling monolithic apps is hard Adding new code is simple when using this architecture model
  18. 18. @didierDIB @Alexandre_Roman We live in a distributed world 18 My app Business domain B Business domain A Cross-cutting domain
  19. 19. @didierDIB @Alexandre_Roman Business app BBusiness app B We live in a distributed world 19 My app Business app A Business app B Gateway (cross-cutting code)
  20. 20. @didierDIB @Alexandre_Roman Scalability is not a problem anymore 20 App instances can be killed at any time What happens when you add a new node? How to scrap metrics from all these instances? Synchronize configurationacross all instances Now you have new problems to tackle...
  21. 21. @didierDIB @Alexandre_Roman Oops, my app is broken! 21 Simply Restart Everything S R E twitter.com/mrb_bk/status/1276548776015138816
  22. 22. @didierDIB @Alexandre_Roman Decentralized metrics and practices Each microservice owns its metrics ★ A microservice is built by a team who knows best how to observe the code 22 No more centralized, static metrics configuration ★ You don’t know how many instances you’ll run: discover app instances at runtime Trace network calls across app instances... and clouds ★ Leveraging open standard such as OpenTracing
  23. 23. @didierDIB @Alexandre_Roman Use Prometheus with Kubernetes apiVersion: apps/v1 kind: Deployment metadata: name: visits spec: selector: matchLabels: app: petclinic tier: visits template: metadata: labels: app: petclinic tier: visits annotations: prometheus.io/scrape: "true" prometheus.io/path: "/actuator/prometheus" prometheus.io/port: "8080" 23
  24. 24. @didierDIB @Alexandre_Roman Add OpenTracing support to your Spring Boot app <!-- Spring Boot Actuator instruments --> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-actuator</artifactId> </dependency> <!-- Spring Cloud Sleuth OpenTracing instruments --> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-sleuth</artifactId> </dependency> 24
  25. 25. Demo Petclinic with microservices deployed to Kubernetes
  26. 26. Less is more Build better metrics
  27. 27. @didierDIB @Alexandre_Roman Expose metrics from a Spring Boot app is so easy Spring Boot relies on Micrometer for metrics ★ Stick to this API for metrics ★ Micrometer is an abstraction layer for metrics: Prometheus, Wavefront, etc. 27 Many metrics exposed by default: memory, requests, etc. Create your own metrics to bring “business” perspective to your app Too ? ★ Prefer quality over quantity
  28. 28. Demo Adding custom metrics to Petclinic
  29. 29. @didierDIB @Alexandre_Roman Create custom dashboards 29
  30. 30. @didierDIB @Alexandre_Roman Create custom metrics final List<PetType> petTypes = repo.findPetTypes(); for (final PetType petType : petTypes) { final String petTypeName = repo.findPetTypeById(petType.getId()).get().getName(); Gauge.builder("petclinic.pets", () -> { return repo.countPetsByType(petType); }).baseUnit("animals") .description("Number of pets") .tag("type", petTypeName) .register(reg); } 30 Rely on MicrometerAPI only
  31. 31. @didierDIB @Alexandre_Roman Create meaningful metrics Gauge.builder("petclinic.pets", () -> { return repo.countPetsByType(petType); }).baseUnit("animals") .description("Number of pets") .tag("type", petTypeName) .register(reg); 31 Naming Meaning + = 󾠮 Implicit contract between code and monitoring tools 󾠯 󾠮 󾠯
  32. 32. Wrapping up
  33. 33. @didierDIB @Alexandre_Roman Better observability leads to better apps to better business 33 More PROACTIVE & efficient Communicate - Collaborate - Act Agility & Trust thru software development lifecycle Learn and Anticipate
  34. 34. Try Wavefront for free! wavefront.com/sign-up Get demo source code github.com/alexandreroman/spring-petclinic-k8s Don’t miss this session Make Your Kubernetes Clusters Production-Ready with Tanzu - Tiffany Jernigan #springone@springone Stay Connected. Questions? Use SpringOne Slack channel #session-welcome-to-the-metrics