Please download to get full document.

View again

of 77

[Spring Camp 2019] Monitoring With Actuator

1. Monitoring With Actuator Spring Camp 2019 서경원 ruddnjs1230@gmail.com 2. 서경원 개발자 모니터링 플랫폼 담당 3. Agenda - Why & How Monitoring -…
0 views77 pages
All materials on our website are shared by users. If you have any questions about copyright issues, please report us to resolve them. We are always happy to assist you.
Documenttranscript
  • 1. Monitoring With Actuator Spring Camp 2019 서경원 ruddnjs1230@gmail.com
  • 2. 서경원 개발자 모니터링 플랫폼 담당
  • 3. Agenda - Why & How Monitoring - Spring Boot Actuator - Metrics Endpoint - Micrometer - Demo - Conclusion
  • 4. Why & How Monitoring Image by Lorenzo Cafaro from Pixabay
  • 5. Why & How Monitoring
  • 6. 장애 예방, 원인 파악, 조치 변경에 대한 상태 확인 성능 개선 장기적인 서비스 상태 분석 Why & How Monitoring
  • 7. Why & How Monitoring 지표가 필요해!!
  • 8. Why & How Monitoring 모니터링 도구 Prometheus KIBANA Atlas InfluxDB Collectd Datadog
  • 9. NHN 사내 모니터링 플랫폼 Why & How Monitoring - 서버 인프라 지표 수집 - 애플리케이션 지표 수집 - 모니터링 차트 제공 - 지표 감시 및 알림
  • 10. Why & How Monitoring 애플리케이션 모니터링 TOMCAT Spring Boot
  • 11. Why & How Monitoring 애플리케이션 모니터링 TOMCAT Spring Boot 지표를 어디서 가져오지? OR 지표를 어떻게 생성하지?
  • 12. Spring Boot Actuator
  • 13. Spring Boot Actuator Spring Boot 애플리케이션을 제어하고 모니터링하기 위한 도구
  • 14. Spring Boot Actuator - 애플리케이션 제어 도구 제공 - endpoints - 애플리케이션 지표 제공 - metrics - 사용 중인 라이브러리 탐지 - 관련 도구 및 지표 제공
  • 15. Spring Boot Actuator Using Spring Boot Actuator Maven Gradle Auto Configuration
  • 16. Spring Boot Actuator health info metrics threaddump heapdump httptrace loggers Endpoints cache mappings configprop env beans sessions shutdown
  • 17. Spring Boot Actuator health info metrics threaddump heapdump httptrace loggers Endpoints cache mappings configprop env beans sessions shutdown
  • 18. Spring Boot Actuator Endpoints 잠깐! Endpoint 사용하기 전에…
  • 19. Spring Boot Actuator Exposing Endpoints Enabling Endpoints
  • 20. Spring Boot Actuator Web Endpoints http://{domain}:{port}/actuator http://{domain}:{port}/actuator/{endpoint-id} JMX Endpoints MBeans -> org.springframework.boot.Endpoint
  • 21. Spring Security Spring Boot Actuator application.properties
  • 22. Spring Boot Actuator Endpoints – metrics 애플리케이션의 측정된 내부 지표 http://{domain}:{port}/actuator/metrics JVM Metrics JDBC Metrics Web(HTTP, Tomcat, Jetty…) Metrics Library Metrics
  • 23. Spring Boot Actuator Metrics URL /actuator/metrics/jvm.memory.used
  • 24. Metrics Endpoint
  • 25. Metrics Endpoint Metrics – Spring Boot 1 계층적 지표 구조 200 응답 /some-url 요청 수 - counter.status.200.some-url 404 응답 /** 요청 수 - counter.status.404.star-star
  • 26. Metrics Endpoint Metrics – Spring Boot 1 “/some-url“ Requests counter.status.200.some-url with region and cloud and exception region.cloud. .exception A Cloud에서 발생한 모든 예외 요청의 수를 보고 싶어요.
  • 27. Metrics Endpoint Metrics – Spring Boot 1
  • 28. Metrics Endpoint Metrics – Spring Boot 2 Dimensional 지표 구조 Tags == Dimension == key/value pair 장점 - 이해하기 쉬움 - 여러 관점에서 지표 분석 가능 - 유연함. 손쉬운 Tag 추가/삭제
  • 29. Metrics Endpoint Metrics URL - /actuator/metrics/jvm.memory.used
  • 30. Metrics Endpoint Metrics with Tags - /actuator/metrics/jvm.memory.used ? tag=area:heap
  • 31. Metrics Endpoint Metrics with Tags - /actuator/metrics/jvm.memory.used ? tag=area:heap & tag=id:Par+Eden+Space
  • 32. Metrics Endpoint Metrics – Infra Resource system.cpu.usage system.cpu.count system.load.average.1m process.cpu.usage process.file.open process.uptime
  • 33. Metrics Endpoint Metrics – JVM jvm.memory.used, committed, max jvm.threads.states jvm.gc.pause jvm.classes.loaded jvm.buffer.capacity
  • 34. Metrics Endpoint http.server.requests http.client.requests logback.events tomcat.* jdbc.* Metrics - Application
  • 35. Metrics Endpoint http.server.requests http.client.requests logback.events tomcat.* jdbc.* Metrics - Application
  • 36. Metrics Endpoint - (Request) Rate - (Request) Errors - (Request) Duration RED Method https://www.weave.works/blog/the-red-method-key-metrics-for-microservices-architecture/ Three key metrics you should measure - Tom Wilkie
  • 37. Metrics Endpoint Metric - http.server.requests
  • 38. Metrics Endpoint Metric - http.server.requests
  • 39. Metrics Endpoint Metric - http.server.requests outcome tag - 1xx -> INFORMATIONAL - 2xx -> SUCCESS - 3xx -> REDIECTION - 4xx -> CLIENT_ERROR - 5xx -> SERVER_ERROR
  • 40. Metrics Endpoint Rate and Duration of Success - http.server.requests?tag=outcome:SUCCESS Rate and Duration of Errors - http.server.requests?tag=outcome:SERVER_ERROR - http.server.requests?tag=exception:IllegalArgumentException Metric - http.server.requests
  • 41. Metrics Endpoint hystrix.* hicaricp.* kafka.* rabbitmq.* cache.* Metric – Third-Party Library
  • 42. Metrics Endpoint hystrix.* hicaricp.* kafka.* rabbitmq.* cache.* Metric – Third-Party Library
  • 43. Metrics Endpoint Circuit Breaker - 장애 내성 / 지연 내성 What is Hystrix? WebApp A WebApp B
  • 44. Metrics Endpoint Circuit Breaker - 장애 내성 / 지연 내성 What is Hystrix? WebApp A WebApp B Open
  • 45. Metrics Endpoint HTTP Request 응답시간 정상화?
  • 46. Metrics Endpoint HTTP Request 응답시간 Hystrix Circuit Breaker No!! Open 상태!
  • 47. Metrics Endpoint /actuator/metrics/jvm.memory.used ?tag=id:Par+Eden+Space&tag=area:heap
  • 48. Metrics Endpoint URL 하나 당 하나의 지표… 하나 하나 가져와야 하나… /actuator/metrics/jvm.memory.used ?tag=id:Par+Eden+Space&tag=area:heap
  • 49. Micrometer
  • 50. Micrometer Spring Boot 2 Actuator based on Micrometer Micrometer
  • 51. Micrometer “Vendor-neutral application metrics facade” “Think SLF4J, but for metric.” Micrometer
  • 52. Micrometer MeterRegistry Atlas Prometheus Influx AWS CloudWatch … 동일한 인터페이스
  • 53. Micrometer https://github.com/micrometer-metrics/micrometer/tree/master/implementations Micrometer Registries
  • 54. Micrometer Using Micrometer Registry – Poll 방식 Auto Configuration by Spring Boot prometheus endpoint 추가 pom.xml
  • 55. Micrometer Endpoint - /actuator/prometheus
  • 56. Micrometer Using Micrometer Registry – Push 방식 pom.xml Auto Configuration by Spring Boot Push Thread 생성
  • 57. Micrometer Using Micrometer Registry – Push 방식 pom.xml application.properties
  • 58. Micrometer Netflix Atlas Graph
  • 59. Micrometer Instrumentation Meter Tag
  • 60. Micrometer Counter Gauge Timer Distribution Summary Long Task Timer Function Counter Function Timer Time Gauge Meters
  • 61. Micrometer
  • 62. Micrometer Histogram Percentile SLA(Service Level Agreement) Meters - Distribution Summary
  • 63. Micrometer Customizing MeterRegistry
  • 64. Micrometer Binder 명시적인 지표 바인딩 Micrometer 자체는 Spring과 독립적인 라이브러리
  • 65. Actuator & Micrometer Demo Image by StartupStockPhotos from Pixabay
  • 66. Conclusion
  • 67. Conclusion Spring Boot Actuator Endpoint Metrics Micrometer Registry Meter Tag
  • 68. Conclusion Server Collector Agent Spring Boot Actuator Prometheus NHN 사내 모니터링 플랫폼
  • 69. Conclusion
  • 70. Conclusion
  • 71. Conclusion
  • 72. Conclusion Dependencies For Monitoring
  • 73. Conclusion Dependencies For Monitoring Spring Boot 1.5
  • 74. Conclusion Pros Cons - Spring Boot Ecosystem - 손쉬운 설치 - 손쉬운 배포 - 손쉬운 커스터마이징 - 백엔드로부터 독립적 - 코드 수준의 상세한 프로파일링 지표 미제공 - Auto Configuration Spring Boot Only 기존 모니터링 에이전트와의 차이점?
  • 75. Conclusion 모든 것을 해결해주지는 않는다. No Silver Bullet! 그러나 짐을 덜어줄 수는 있을 것이다.
  • 76. Thank You!
  • 77. 데모 코드 https://github.com/kwSeo/springcamp2019-monitoring-demo
  • Advertisement
    MostRelated
    View more
    We Need Your Support
    Thank you for visiting our website and your interest in our free products and services. We are nonprofit website to share and download documents. To the running of this website, we need your help to support us.

    Thanks to everyone for your continued support.

    No, Thanks
    SAVE OUR EARTH

    We need your sign to support Project to invent "SMART AND CONTROLLABLE REFLECTIVE BALLOONS" to cover the Sun and Save Our Earth.

    More details...

    Sign Now!

    We are very appreciated for your Prompt Action!

    x