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

Life with Datadog

Takeshi Kondo
January 24, 2021

Life with Datadog

July Tech Festa 2021 winter
https://techfesta.connpass.com/event/193966/

Takeshi Kondo

January 24, 2021
Tweet

More Decks by Takeshi Kondo

Other Decks in Technology

Transcript

  1. Life with Datadog
    Takeshi Kondo / @chaspy
    2021/01/24
    July Tech Festa Winter 2021

    View full-size slide

  2. Who am I
    chaspy chaspy_
    Lead Software Engineer

    Site Reliability at Quipper
    Takeshi Kondo

    View full-size slide

  3. Japan Datadog User Group Organizer
    • https://datadog-jp.connpass.com/

    View full-size slide

  4. Software Design 2݄߸ʹDatadog ϋϯζΦϯهࣄΛدߘ
    • ʲୈ2ಛूʳγεςϜ؂ࢹͷ࢝Ίํɾଓ͚ํ ୈ3ষ Datadog
    Ͱ࣮ફ͢ΔSaaS؂ࢹ
    https://twitter.com/chaspy_/status/1350270946767081472?s=20
    Datadog ॳ৺ऀͷํ͸ͥͻʂ

    View full-size slide

  5. TγϟπͱۺԼ͍͖ͨͩ·ͨ͠
    https://twitter.com/chaspy_/status/1352577570278043649?s=20
    ཉ͍͠ͻͱ͸ meetup Ͱ࿩ͨ͠Γ
    ϞϒϓϩࢀՃ͢Δͱ΋Β͑Δ͔΋ʂ

    View full-size slide

  6. ࠓ೔͸ Datadog ΁ͷѪΛޠΓ·͢
    https://www.datadoghq.com/about/resources/
    Monitoring SaaS

    View full-size slide

  7. ࠓ೔ͷൃද
    • ର৅
    • γεςϜӡ༻ऀ
    • Monitoring SaaS ʹڵຯ͕͋Δͻͱ
    • Datadog ʹڵຯ͕͋Δͻͱ
    • ΰʔϧ
    • Datadog ͷྑ͞Λ஌Δ
    • Datadog ͷ༷ʑͳԠ༻ػೳΛ஌Δ͜ͱͰ׆༻ͷώϯτΛಘΔ

    View full-size slide

  8. Agenda
    • Datadog ͷ޷͖ͳͱ͜Ζ
    • ϓϩμΫτѪᷓΕΔαϙʔτ
    • ϦονͰΩϡʔτͳ GUI
    • SLO Summary & Alert
    • Datadog ͱͷੜ׆
    • Monitor Summary
    • Weekly Summary
    • Alfred ͱͷ૊Έ߹Θͤ
    • Datadog ͱͷੜ׆ Ԡ༻ฤ
    • Datadog Cost ͱͷ޲͖߹͍ํ
    • ৽نαʔϏεͱ Datadog
    • Custom Metrics ͷ׆༻

    View full-size slide

  9. Agenda
    • Datadog ͷ޷͖ͳͱ͜Ζ
    • ϓϩμΫτѪᷓΕΔαϙʔτ
    • ϦονͰΩϡʔτͳ GUI
    • SLO Summary & Alert
    • Datadog ͱͷੜ׆
    • Monitor Summary
    • Weekly Summary
    • Alfred ͱͷ૊Έ߹Θͤ
    • Datadog ͱͷੜ׆ Ԡ༻ฤ
    • Datadog Cost ͱͷ޲͖߹͍ํ
    • ৽نαʔϏεͱ Datadog
    • Custom Metrics ͷ׆༻

    View full-size slide

  10. Datadog ͷ޷͖ͳͱ͜Ζɿαϙʔτ͕͍͢͝
    • Ϩεϙϯε͕ૣ͍(΄΅࣮֬ʹ24hҎ಺ʹؼͬͯ͘Δʣ
    • ճ౴͕త֬
    • Ͱ͖ͳ͍͜ͱͰ΋ϫʔΫΞϥ΢ϯυΛҊ಺ͯ͘͠ΕΔ
    • ϓϩμΫτΛྑ͘͠Α͏ͱ͍͏࢟੎͕ݟ͑Δ

    View full-size slide

  11. αϙʔτʹ͓ئ͍͢Δํ๏
    • جຊνέοτΛىථͯ͠Δʢӳޠʣ
    • Help -> resource -> Tickets & Email Support
    • Ͳ͏ͯ͠΋ӳޠແཧͳΒ೔ຊޠͰͷճ౴Λ͓ئ͍͢Ε͹೔ຊ
    αϙʔτʹӦۀ࣌ؒͯ͘͠ΕΔΒ͍͠
    • Event Stream ʹ @support-datadog Λଧͯ͹ live chat ΋Ͱ
    ͖ΔΒ͍͠ʢ΍ͬͨ͜ͱͳ͍͕ʣ

    View full-size slide

  12. աڈͷ࣭໰ྫ
    • Terraform Ͱ SLO ͷ Apply ͕ Invalid Query ͰౖΒΕΔ
    • Monitor Summary Λ metrics ͱͯ͠औΕͳ͍͔૬ஊ
    • EKS Control Plane ͷ metrics औಘํ๏
    • SLO ҧ൓ͨ͠ͱ͖ʹΞϥʔτΛඈ͹͢ํ๏
    • API Key ͷ਺Λ૿΍ͤͳ͍͔૬ஊ

    View full-size slide

  13. աڈͷ࣭໰ྫ
    • Terraform Ͱ SLO ͷ Apply ͕ Invalid Query ͰౖΒΕΔ
    • Monitor Summary Λ metrics ͱͯ͠औΕͳ͍͔૬ஊ
    • EKS Control Plane ͷ metrics औಘํ๏
    • SLO ҧ൓ͨ͠ͱ͖ʹΞϥʔτΛඈ͹͢ํ๏
    • API Key ͷ਺Λ૿΍ͤͳ͍͔૬ஊ

    View full-size slide

  14. Monitor Summary Λ metrics ͱͯ͠औΕͳ͍͔૬ஊ
    • Monitor Summary ஌ͬͯ·͔͢ʁ
    • िʹҰ౓ϝʔϧདྷͯΔ΍ͭ
    • https://app.datadoghq.com/report/monitor
    • ࣮͸ GUI ͔Βಋઢ͕ͳ͍ʢϝʔϧ͔Β͔͠ඈ΂ͳ͍ʣ

    View full-size slide

  15. Monitor Summary

    View full-size slide

  16. Monitor Summary
    ೚ҙͷνϟϯωϧͷΞϥʔτ
    ͚ͩϑΟϧλ͍ͨ͠

    View full-size slide

  17. Raw data(CSV) ͕ api ͰऔΕΔΒ͍͠
    • CSV ͕μ΢ϯϩʔυͰ͖Δ
    • ͜ͷ CSV ͔Β custom metrics ΛૹΔίʔυΛॻ͍ͨ
    https://app.datadoghq.com/report/hourly_data/monitor
    https://docs.datadoghq.com/monitors/faq/how-can-i-export-alert-history/?tab=us

    View full-size slide

  18. SLO ҧ൓ͨ͠ͱ͖ʹΞϥʔτΛඈ͹͢ํ๏
    • ౰࣌͸·ͩ SLO Error Budget Alert ͷػೳ͸ͳ͔ͬͨ
    • Product Manager ͕ग़ͯ͘Δɻͦͷػೳ͸ઈࢍ։ൃதͰɺ
    ϢʔβΠϯλϏϡʔΛͤͯ͘͞Εͳ͍͔ͱݴͬͯ͘Δ
    • Support Ticket ্Ͱ͍͔࣭ͭ͘໰ʹ౴͑Δ
    • ͦͷޙແࣄ SLO Alert Beta ϦϦʔε!

    View full-size slide

  19. Τϯήʔδϝϯτͷߴ·Γ

    View full-size slide

  20. ϦονͰΩϡʔτͳGUI

    View full-size slide

  21. ϦονͰΩϡʔτͳGUI
    • ՄࢹԽͷํ๏͕ଟ͍
    • ͙͢ʹ൓ө͞ΕΔ
    • ؔ਺͕ଟ͍
    • ίϐϖָ͕

    View full-size slide

  22. ࣮ࡍʹάϥϑΛ͍ͬͯ͡ΈΑ͏

    View full-size slide

  23. SLO Summary & Alert

    View full-size slide

  24. SLO Summary & Alert

    View full-size slide

  25. Datadog ͷ SLO ػೳ͸ͳͯ͘͸ͳΒͳ͍૬๮
    https://quipper.hatenablog.com/entry/2020/01/30/slo-review

    View full-size slide

  26. Terraform ؅ཧ & generator Ͱ৽نαʔϏε࡞
    ੒࣌ʹ΋؆୯ʹ࡞੒Ͱ͖Δ
    ࣮ࡍʹݟͯΈΑ͏

    View full-size slide

  27. Agenda
    • Datadog ͷ޷͖ͳͱ͜Ζ
    • ϓϩμΫτѪᷓΕΔαϙʔτ
    • ϦονͰΩϡʔτͳ GUI
    • SLO Summary & Alert
    • Datadog ͱͷੜ׆
    • Monitor Summary
    • Weekly Summary
    • Alfred ͱͷ૊Έ߹Θͤ
    • Datadog ͱͷੜ׆ Ԡ༻ฤ
    • Datadog Cost ͱͷ޲͖߹͍ํ
    • ৽نαʔϏεͱ Datadog
    • Custom Metrics ͷ׆༻

    View full-size slide

  28. Monitor Summary Λຖே Daily Standup Ͱݟ͍ͯΔ

    View full-size slide

  29. Monitor Summary
    • >muted:false tag:(("severity:alert" OR
    "severity:emergency") AND "team:sre")
    • ͢΂ͯͷ Alert ʹ severity tag ͱ team tag ͕͍͍ͭͯΔ
    • ࣗ෼ͨͪͷ୲౰ͷΞϥʔτͷΈΛ Daily Standup Ͱ Check
    • NG ͩͬͨΒ೔ຖͷ୲౰ऀ͕ରॲ͢Δ

    View full-size slide

  30. Weekly Summary
    • ͜͏͍͏ϝʔϧ͕དྷ͍ͯ·͢
    • [Monitor Report] You received xxx alerts

    View full-size slide

  31. Weekly Summary
    • ࣮͸͜͜ͰݟΕΔ
    • https://app.datadoghq.com/report/monitor
    • ΫϦοΫ͢Δͱि΍࣌ؒଳ΍Ξϥʔτνϟϯωϧɺmonitor
    ͰߜΓࠐΈ͕Ͱ͖Δ
    • ͜ΕΛݟͯΞϥʔτͷ਺ࣗମͷਪҠΛ௥͍ͬͯΔ

    View full-size slide

  32. Alfred ͱͷ૊Έ߹Θͤ
    • Dashboard, monitor, SLO Λαοͱ։͚ΔΑ͏ʹ
    • Web Search ొ࿥͍ͯ͠Δ
    • ddd https://app.datadoghq.com/dashboard/lists?q={query}
    • ddm https://app.datadoghq.com/monitors/manage?q={query}
    • ddslo https://app.datadoghq.com/slo?query={query}

    View full-size slide

  33. Agenda
    • Datadog ͷ޷͖ͳͱ͜Ζ
    • ϓϩμΫτѪᷓΕΔαϙʔτ
    • ϦονͰΩϡʔτͳ GUI
    • SLO Summary & Alert
    • Datadog ͱͷੜ׆
    • Monitor Summary
    • Weekly Summary
    • Alfred ͱͷ૊Έ߹Θͤ
    • Datadog ͱͷੜ׆ Ԡ༻ฤ
    • Datadog Cost ͱͷ޲͖߹͍ํ
    • ৽نαʔϏεͱ Datadog
    • Custom Metrics ͷ׆༻

    View full-size slide

  34. Datadog Cost ͷܭࢉࣜ
    • ݄ؒͷϗετ਺ͷ 99 percentile (max Ͱ͸ͳ͍)
    • ϗετ਺Λ࡟ݮ͢Δͱ Datadog Cost ΋ݮΔ
    • ϗετ਺ΛݮΒ͔͢͠ͳ͍ʢԦಓͳ͠ʣ

    View full-size slide

  35. ৽نαʔϏεͱ Datadog
    • ৽نαʔϏεߏங࣌ʹ͸"Production Readiness Checklist"
    ͕͋Δ
    https://quipper.hatenablog.com/entry/2020/01/30/production-readiness-with-all

    View full-size slide

  36. Production Readiness Checklist - Monitoring / Logging

    View full-size slide

  37. Template Dashboard

    View full-size slide

  38. ࣮ࡍʹ Template Dashboard ΛݟͯΈΑ͏

    View full-size slide

  39. Production Readiness Checklist - SLI/SLO
    • Generator Λ࢖ͬͯ࡞ͬͯ Dashboard ʹ௥Ճ͢Δ͚ͩʂ
    • SLO ࣗମΛԿʹ͢Δ͔͸ Design Doc ϑΣʔζͰࡦఆ͢Δ

    View full-size slide

  40. Custom metrics ͷ׆༻ྫ
    • CI Ͱ͔͔ͬͨ࣌ؒΛଌఆ
    • Docker build ͷ࣌ؒɺ֤ςετͷ࣌ؒͳͲ
    • CircleCI ͷίετΛଌఆɺՄࢹԽ
    • Dependabot ʹΑͬͯ open ʹͳͬͯΔ PR ਺ΛՄࢹԽ
    • εύΠΫΞΫηεΛ๷͙ͨΊʹෛՙ৘ใΛ custom metrics ͱͯ͠ૹ
    ΓɺKubernetes HPA ͔Βར༻

    View full-size slide

  41. Kubernetes meetup tokyo #38 Ͱ࿩͠·ͨ͠
    https://twitter.com/chaspy_/status/1352194206962388995?s=20
    https://speakerdeck.com/chaspy/v2beta2-and-examples-of-using-hpa-external-metrics-with-datadog
    https://quipper.hatenablog.com/entry/2020/11/30/scheduled-scaling-with-hpa

    View full-size slide

  42. Custom metric ͱͯ͠਎ͷճΓͷ৘ใΛૹΔϝϦοτ
    • ݱঢ়ΛՄࢹԽͰ͖Δ
    • ೚ҙͷλά౳ͰϑΟϧλ/আ֎Ͱ͖Δ
    • Metric ͔ΒΞϥʔτΛൃ๒Ͱ͖Δ

    View full-size slide

  43. Custom metrics ΛૹΔ design pattern
    • Kubernetes ؀ڥͩͱ Autodiscovery ػೳ͕ศར
    https://docs.datadoghq.com/agent/kubernetes/integrations/?tab=kubernetes
    API ͕͋Δ֎෦γεςϜ
    Custom metric ੜ੒͢Δ܅
    (Kubernetes Deployment)
    API Ͱσʔλऔಘ
    Datadog-agent
    http Ͱ prometheus ܗࣜͰ
    metric Λ export

    View full-size slide

  44. Custom metrics ΛૹΔ design pattern
    • Kubernetes ؀ڥͩͱ Autodiscovery ػೳ͕ศར
    https://docs.datadoghq.com/agent/kubernetes/integrations/?tab=kubernetes
    API ͕͋Δ֎෦γεςϜ
    Custom metric ੜ੒͢Δ܅
    (Kubernetes Deployment)
    API Ͱσʔλऔಘ
    Datadog-agent
    1 annotations:
    2 ad.datadoghq.com/timed-exam-schedule-exporter.check_names: |
    3 ["prometheus"]
    4 ad.datadoghq.com/timed-exam-schedule-exporter.init_configs:
    |
    5 [{}]
    6 ad.datadoghq.com/timed-exam-schedule-exporter.instances: |
    7 [
    8 {
    9 "prometheus_url": "http://%%host%%:8080/metrics",
    10 "namespace": "namespace",
    11 "metrics": ["*"]
    12 }
    13 ]

    View full-size slide

  45. Custom metrics ΛૹΔ design pattern
    • Kubernetes ؀ڥͩͱ Autodiscovery ػೳ͕ศར
    https://docs.datadoghq.com/agent/kubernetes/integrations/?tab=kubernetes
    API ͕͋Δ֎෦γεςϜ
    Custom metric ੜ੒͢Δ܅
    (Kubernetes Deployment)
    API Ͱσʔλऔಘ
    Datadog-agent
    • GitHub ͷ PR ΍ issue
    • AWS Security Event(GuardDuty / ECR
    Image Scan)
    • OS ͝ͱͷ EC2 Horst ਺
    • RDS ͷ version ͝ͱͷΫϥελ਺

    View full-size slide

  46. ·ͱΊ
    • Datadog Ͱ෼͔Βͳ͍͜ͱ͕͋ͬͨΒ...
    • ͙͢ʹ Support ʹฉ͜͏ʂૣͯ͘ஸೡʂ
    • Japan Datadog User Group ͷ Slack Ͱฉ͍ͯ΋ okʂ
    • Monitor Summary ͱ Weekly Report Ͱ Monitor ࣗମ΋ݮΒͯ͠
    ͍͜͏
    • Custom metrics ͦ͜ Datadog ͷ୉ޣຯɺͲΜͲΜ׆༻͠Α͏ʂ

    View full-size slide

  47. More
    • ࣮ࡍͷάϥϑͱ͔ݟ͍ͨͻͱ͸࿥ըͷͳ͍࣌ʹདྷͯʂ
    • ͜ͷ͋ͱͷ zoom breakout room Ͱ΋Α͠
    • ݸผʹ Twitter Ͱ࿈བྷ͘ΕΕ͹ Datadog ૬ஊ৐Γ·͢

    View full-size slide

  48. Thank you!
    chaspy chaspy_
    Lead Software Engineer

    Site Reliability at Quipper
    Takeshi Kondo

    View full-size slide