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. ࠓ೔ͷൃද • ର৅ • γεςϜӡ༻ऀ • Monitoring SaaS ʹڵຯ͕͋Δͻͱ •

    Datadog ʹڵຯ͕͋Δͻͱ • ΰʔϧ • Datadog ͷྑ͞Λ஌Δ • Datadog ͷ༷ʑͳԠ༻ػೳΛ஌Δ͜ͱͰ׆༻ͷώϯτΛಘΔ
  2. Agenda • Datadog ͷ޷͖ͳͱ͜Ζ • ϓϩμΫτѪᷓΕΔαϙʔτ • ϦονͰΩϡʔτͳ GUI •

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

    SLO Summary & Alert • Datadog ͱͷੜ׆ • Monitor Summary • Weekly Summary • Alfred ͱͷ૊Έ߹Θͤ • Datadog ͱͷੜ׆ Ԡ༻ฤ • Datadog Cost ͱͷ޲͖߹͍ํ • ৽نαʔϏεͱ Datadog • Custom Metrics ͷ׆༻
  4. αϙʔτʹ͓ئ͍͢Δํ๏ • جຊνέοτΛىථͯ͠Δʢӳޠʣ • Help -> resource -> Tickets &

    Email Support • Ͳ͏ͯ͠΋ӳޠແཧͳΒ೔ຊޠͰͷճ౴Λ͓ئ͍͢Ε͹೔ຊ αϙʔτʹӦۀ࣌ؒͯ͘͠ΕΔΒ͍͠ • Event Stream ʹ @support-datadog Λଧͯ͹ live chat ΋Ͱ ͖ΔΒ͍͠ʢ΍ͬͨ͜ͱͳ͍͕ʣ
  5. աڈͷ࣭໰ྫ • Terraform Ͱ SLO ͷ Apply ͕ Invalid Query

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

    ͰౖΒΕΔ • Monitor Summary Λ metrics ͱͯ͠औΕͳ͍͔૬ஊ • EKS Control Plane ͷ metrics औಘํ๏ • SLO ҧ൓ͨ͠ͱ͖ʹΞϥʔτΛඈ͹͢ํ๏ • API Key ͷ਺Λ૿΍ͤͳ͍͔૬ஊ
  7. Monitor Summary Λ metrics ͱͯ͠औΕͳ͍͔૬ஊ • Monitor Summary ஌ͬͯ·͔͢ʁ •

    िʹҰ౓ϝʔϧདྷͯΔ΍ͭ • https://app.datadoghq.com/report/monitor • ࣮͸ GUI ͔Βಋઢ͕ͳ͍ʢϝʔϧ͔Β͔͠ඈ΂ͳ͍ʣ
  8. 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
  9. SLO ҧ൓ͨ͠ͱ͖ʹΞϥʔτΛඈ͹͢ํ๏ • ౰࣌͸·ͩ SLO Error Budget Alert ͷػೳ͸ͳ͔ͬͨ •

    Product Manager ͕ग़ͯ͘Δɻͦͷػೳ͸ઈࢍ։ൃதͰɺ ϢʔβΠϯλϏϡʔΛͤͯ͘͞Εͳ͍͔ͱݴͬͯ͘Δ • Support Ticket ্Ͱ͍͔࣭ͭ͘໰ʹ౴͑Δ • ͦͷޙແࣄ SLO Alert Beta ϦϦʔε!
  10. Agenda • Datadog ͷ޷͖ͳͱ͜Ζ • ϓϩμΫτѪᷓΕΔαϙʔτ • ϦονͰΩϡʔτͳ GUI •

    SLO Summary & Alert • Datadog ͱͷੜ׆ • Monitor Summary • Weekly Summary • Alfred ͱͷ૊Έ߹Θͤ • Datadog ͱͷੜ׆ Ԡ༻ฤ • Datadog Cost ͱͷ޲͖߹͍ํ • ৽نαʔϏεͱ Datadog • Custom Metrics ͷ׆༻
  11. Monitor Summary • >muted:false tag:(("severity:alert" OR "severity:emergency") AND "team:sre") •

    ͢΂ͯͷ Alert ʹ severity tag ͱ team tag ͕͍͍ͭͯΔ • ࣗ෼ͨͪͷ୲౰ͷΞϥʔτͷΈΛ Daily Standup Ͱ Check • NG ͩͬͨΒ೔ຖͷ୲౰ऀ͕ରॲ͢Δ
  12. 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}
  13. Agenda • Datadog ͷ޷͖ͳͱ͜Ζ • ϓϩμΫτѪᷓΕΔαϙʔτ • ϦονͰΩϡʔτͳ GUI •

    SLO Summary & Alert • Datadog ͱͷੜ׆ • Monitor Summary • Weekly Summary • Alfred ͱͷ૊Έ߹Θͤ • Datadog ͱͷੜ׆ Ԡ༻ฤ • Datadog Cost ͱͷ޲͖߹͍ํ • ৽نαʔϏεͱ Datadog • Custom Metrics ͷ׆༻
  14. Datadog Cost ͷܭࢉࣜ • ݄ؒͷϗετ਺ͷ 99 percentile (max Ͱ͸ͳ͍) •

    ϗετ਺Λ࡟ݮ͢Δͱ Datadog Cost ΋ݮΔ • ϗετ਺ΛݮΒ͔͢͠ͳ͍ʢԦಓͳ͠ʣ
  15. Custom metrics ͷ׆༻ྫ • CI Ͱ͔͔ͬͨ࣌ؒΛଌఆ • Docker build ͷ࣌ؒɺ֤ςετͷ࣌ؒͳͲ

    • CircleCI ͷίετΛଌఆɺՄࢹԽ • Dependabot ʹΑͬͯ open ʹͳͬͯΔ PR ਺ΛՄࢹԽ • εύΠΫΞΫηεΛ๷͙ͨΊʹෛՙ৘ใΛ custom metrics ͱͯ͠ૹ ΓɺKubernetes HPA ͔Βར༻
  16. 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
  17. 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 ]
  18. 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 ͝ͱͷΫϥελ਺
  19. ·ͱΊ • Datadog Ͱ෼͔Βͳ͍͜ͱ͕͋ͬͨΒ... • ͙͢ʹ Support ʹฉ͜͏ʂૣͯ͘ஸೡʂ • Japan

    Datadog User Group ͷ Slack Ͱฉ͍ͯ΋ okʂ • Monitor Summary ͱ Weekly Report Ͱ Monitor ࣗମ΋ݮΒͯ͠ ͍͜͏ • Custom metrics ͦ͜ Datadog ͷ୉ޣຯɺͲΜͲΜ׆༻͠Α͏ʂ