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

Syntheticsで簡単外形監視!

18f1e3993e9ead63e7a0f70d9eb996bb?s=47 wkm2
May 09, 2020

 Syntheticsで簡単外形監視!

JAWS-UG新潟#8の登壇資料です

18f1e3993e9ead63e7a0f70d9eb996bb?s=128

wkm2

May 09, 2020
Tweet

Transcript

  1. SyntheticsͰ؆୯֎ܗ؂ࢹʂ 2020/5/9 JAWS-UG ৽ׁ #8 एদ ߶ࢤ

  2. Who am I ? • एদ ߶ࢤ / Takeshi Wakamatsu

    • ΞΠϨοτגࣜձࣾ / cloudpack • ΠϯϑϥΤϯδχΞ + PM + Ϛωʔδϟ • AWSͷ(ओʹΠϯϑϥνοΫͳ)ߏஙɺӡ༻Λ୲౰ • JAWS-UG ॳ৺ऀࢧ෦ͷӡӦ΍ͬͯͨ͜ͱ΋ @t_wkm2
  3. ৽ׁͱͷ͝ԑ • ࣮͸5೥ؒॅΜͰ·ͨ͠ʂ • ݩΞϧϏϑΝϯ(2009~2013ࠒ) • ΞΠγςϧ—χΠΨλ • ΠλϦΞϯ͸Έ͔͖ͮ೿(͋Μ·Γ৯΂ͳ͔͚ͬͨͲ) •

    ώϚͳͱ͖͸ُδϟεʹߦ͘
  4. SyntheticsͰ؆୯֎ܗ؂ࢹʂ

  5. ֎ܗ؂ࢹͬͯͳΜͩʁ

  6. ֎ܗ؂ࢹͬͯͳΜͩʁ • γεςϜ֎෦͔Βݟͨͱ͖ʹਖ਼ৗͳಈ࡞Λ͍ͯ͠Δ͔Λ؂ࢹ͢Δ͜ͱ • ओʹURL؂ࢹʹ࢖ΘΕΔ༻ޠ • ΄Μͱ͸֎ܗ؂ࢹͱ͍͏ݴ༿͸ద౰Ͱͳ͍Β͍͠(Ͳ͏Ͱ΋͍͍)

  7. SyntheticsͬͯͳΜͩʁ

  8. SyntheticsͬͯͳΜͩʁ • Amazon CloudWatch Synthetics ͷ͜ͱ • LambdaͳͲͷطଘϦιʔεΛ૊Έ߹Θͤͨπʔϧ • ͓खܰʹ֎ܗ؂ࢹͰ͖Δ

    • ॕʂGAʂ (2020/4/23)
  9. Synthetics ʹ ߹੒؂ࢹ ͱͷ͏Θ͞ • ߹੒ = ਓ޻తͳ΋ͷ • ਓ޻త͡Όͳ͍

    ʹ ਓ͕ϒϥ΢β౳ͰΞΫηε͢Δ΋ͷ • ߹੒؂ࢹ͸ਓ͕ૢ࡞͢ΔڍಈΛػցతʹ໛ͯ͠ਖ਼ৗʹಈ࡞͢Δ͔Λ؂ ࢹ͢Δ • SeleniumΛΠϝʔδͯ͠΋Β͑Ε͹Θ͔Γ΍͍͢
  10. ؆୯ʂ֎ܗ؂ࢹઃఆʂ

  11. ࠓճͷΰʔϧ • ୯७ͳURL؂ࢹ(HTTP Status Code : 200͕ฦΔ͜ͱΛਖ਼ৗͱ͢Δ) • ҟৗ(200Ҏ֎͕ฦΔ)Λݕ஌ͨ͠৔߹ʹϝʔϧΛૹ৴

  12. ࠓճ࡞੒͢ΔSyntheticsͷΠϝʔδ

  13. લఏ৚݅ • ؂ࢹର৅ͷURL͕طʹଘࡏ͢Δ • ࠓճ͸ALB→EC2Λ࡞੒ࡁΈ • Amazon SNSͰτϐοΫΛ࡞੒ࡁΈ • ϝʔϧΞυϨε΋ೝূࡁΈͰϝʔϧ͕ૹΕΔঢ়ଶ

    • ը໘Ωϟϓνϟ͸2020/5/9ݱࡏͷ΋ͷͳͷͰɺมߋ͞ΕΔՄೳੑ͋Γ
  14. CanaryΛ࡞੒͢Δ • Synthetisͷ؂ࢹ͸Canaryͱ͍͏୯ҐͰ࡞੒Ͱ͖Δ • CloudWatchϖʔδͷࠨϖΠϯΛݟΔͱίίʹ͋Δ

  15. CanaryΛ࡞੒͢Δ • “CanaryΛ࡞੒” Λԡͯ͠࡞੒Λ࢝ΊΔ

  16. CanaryΛ࡞੒͢Δ • σϑΥϧτͰ “ϋʔτϏʔτͷϞχλϦϯά” ͕બ୒͞Ε͍ͯΔͷͰɺ ͦͷ··࣍΁ • Canaryͷ “໊લ” ͱ

    “ΤϯυϙΠϯτURL” Λೖྗ
  17. CanaryΛ࡞੒͢Δ • CloudWatch ΞϥʔϜΛઃఆ͢Δ • “৽͍͠ΞϥʔϜͷ௥Ճ” Λԡͯ͠ΞϥʔϜΛ࡞੒͢Δ • σϑΥϧτͰ੒ޭ཰͕90%ҎԼʹͳͬͨΒΞϥʔϜʹͳΔઃఆ

  18. CanaryΛ࡞੒͢Δ • ΞϥʔϜʹͳͬͨࡍͷ௨஌Λઃఆ͢Δ • “͜ͷ Canary ͷ௨஌Λઃఆ͢Δ” ͕͋ΔͷͰ։͘ • ࠓճ͸طଘͰ

    “wakamatsu-alert” Λ࡞੒͍ͯ͠ΔͷͰɺͦΕΛબ୒
  19. CanaryΛ࡞੒͢Δ • ओͳઃఆ͸ऴΘͬͨͷͰɺҰ൪Լʹ͋Δ “CanaryΛ࡞੒” Λԡͯ͠࡞ ੒Λ׬ྃ • ࡞੒·Ͱগ͕͔͔࣌ؒ͠Δ

  20. Canary࡞੒੒ޭʂ • CanaryΛ࡞੒ͯ͠؂ࢹ͕੒ޭ͢Δͱ͜Μͳײ͡

  21. WebServerΛఀࢭͯ͠ΈΔͱɺɺ • EC2ͰApache(httpd)͕ಈ͍͍ͯΔͷͰɺ͜ΕΛࢭΊΔͱɺɺ

  22. ੒ޭ཰͕90%ҎԼʹͳͬͨͷͰ • ͜Μͳϝʔϧ͕དྷΔ

  23. Goal !!

  24. ·ͱΊ

  25. ·ͱΊ • ֎ܗ؂ࢹ͸γεςϜ֎෦͔Βਖ਼ৗͳ͜ͱΛ؂ࢹ͢Δ • Synthetics͸URL؂ࢹ͔Β߹੒؂ࢹ·ͰରԠ͍ͯ͠Δ • ؆୯ʹઃఆͰ͖ΔͷͰੋඇ͓ࢼ͠Λʂ