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

OpenTelemetry入門へGo

 OpenTelemetry入門へGo

More Decks by 株式会社ビットキー / Bitkey Inc.

Other Decks in Technology

Transcript

  1. 1. ࣗݾ঺հ  • OSOSL ͷΓͷΓ͖  ◦ ຊ໊ߴڮయੜ ͔ͨ͸͠ͷΓ͖

     ◦ 5XJUUFS!OPSJOPSJLJ ◦ (JU)VCOSOSL • גࣜձࣾ#JULFZ ◦ CJULFZQMBUGPSNͱ͍͏zΧΪzͷϓϥοτϑΥʔϜͷ։ൃ • ओʹࣾ಺޲͚ͷΧΪͷϓϥοτϑΥʔϜαʔϏεΛ(PͰఏڙ͍ͯ͠·͢ • झຯ਺ֶɾ෺ཧֶ ◦ [L4/"3,Tͷ਺ֶతͳଆ໘ΛטΈࡅ͘هࣄΛॻ͍ͨΓͯ͠·͢
  2. • #JULFZͷͭͷࣄۀυϝΠϯ ◦ )PNFʢ฻Β͠ʣ ◦ 8PSLTQBDFʢಇ͘ʣ ◦ &YQFSJFODFʢඇ೔ৗͷମݧʣ • CJULFZQMBUGPSN

    ◦ ͭͷIVCΞϓϦέʔγϣϯͷج൫ 1. ࣗݾ঺հ  ςΫϊϩδʔͷྗͰ͋ΒΏΔ΋ͷΛ ҆શͰศརͰؾ࣋ͪΑ͘ʮͭͳ͛Δʯ
  3. • 0QFO5FMFNFUSZ͕αϙʔτ͢Δ෼໺ ◦ 5SBDFT ▪ ϢʔβʔϦΫΤετ͕དྷͨͱ͖ͷΞϓϦέʔγϣϯͷશମ૾Λඳը ◦ .FUSJDT ▪ ࣮ߦ࣌ͷαʔϏεͷঢ়ଶͷܭଌ

    ◦ -PHT ▪ λΠϜελϯϓΛؚΉϝλσʔλ෇͖ͷه࿥ ◦ #BHHBHF ▪ εύϯ ޙड़ ؒͷίϯςΩετΛ࣋ͬͨ৘ใͷू·Γ  2. OpenTelemetry ͱ͸
  4. • 0QFO5FMFNFUSZ͕αϙʔτ͢Δ෼໺ ◦ 5SBDFT ▪ ϢʔβʔϦΫΤετ͕དྷͨͱ͖ͷΞϓϦέʔγϣϯͷશମ૾Λඳը ◦ .FUSJDT ▪ ࣮ߦ࣌ͷαʔϏεͷঢ়ଶͷܭଌ

    ◦ -PHT ▪ λΠϜελϯϓΛؚΉϝλσʔλ෇͖ͷه࿥ ◦ #BHHBHF ▪ εύϯ ޙड़ ؒͷίϯςΩετΛ࣋ͬͨ৘ใͷू·Γ  2. OpenTelemetry ͱ͸ ࠓճͷ࿩͸͜͜ʹ͍ͭͯ
  5. • ෼ࢄτϨʔγϯάαʔϏεͱͷؔ܎ ◦ ෼ࢄτϨʔγϯάαʔϏε ▪ (PPHMF5SBDF"1* ▪ "8493BZ ▪ 044+BFHFS

    ΠΣʔΨʔ ͳͲ ◦ ˠ0QFO5FMFNFUSZͷ࢓༷ͰΠϯλʔϑΣΠε͕ڞ௨Խ  2. OpenTelemetry ͱ͸
  6. • ෼ࢄτϨʔγϯάαʔϏεͱͷؔ܎ ◦ ෼ࢄτϨʔγϯάαʔϏε ▪ (PPHMF5SBDF"1* ▪ "8493BZ ▪ 044+BFHFS

    ΠΣʔΨʔ ͳͲ ◦ ˠ0QFO5FMFNFUSZͷ࢓༷ͰΠϯλʔϑΣΠε͕ڞ௨Խ  2. OpenTelemetry ͱ͸
  7. • ෼ࢄτϨʔγϯάαʔϏεͱͷؔ܎ ◦ ෼ࢄτϨʔγϯάαʔϏε ▪ (PPHMF5SBDF"1* ▪ "8493BZ ▪ 044+BFHFS

    ΠΣʔΨʔ ͳͲ ◦ ˠ0QFO5FMFNFUSZͷ࢓༷ͰΠϯλʔϑΣΠε͕ڞ௨Խ  2. OpenTelemetry ͱ͸
  8. • ෼ࢄτϨʔγϯάαʔϏεͱͷؔ܎ ◦ ෼ࢄτϨʔγϯάαʔϏε ▪ (PPHMF5SBDF"1* ▪ "8493BZ ▪ 044+BFHFS

    ΠΣʔΨʔ ͳͲ ◦ ˠ0QFO5FMFNFUSZͷ࢓༷ͰΠϯλʔϑΣΠε͕ڞ௨Խ  2. OpenTelemetry ͱ͸
  9. • ෼ࢄτϨʔγϯάαʔϏεͱͷؔ܎ ◦ ෼ࢄτϨʔγϯάαʔϏε ▪ (PPHMF5SBDF"1* ▪ "8493BZ ▪ 044+BFHFS

    ΠΣʔΨʔ ͳͲ ◦ ˠ0QFO5FMFNFUSZͷ࢓༷ͰΠϯλʔϑΣΠε͕ڞ௨Խ  2. OpenTelemetry ͱ͸
  10. • 0QFO5FMFNFUSZ5SBDFT͕ͳ͍ͱ͖ ◦ ෼ࢄΞʔΩςΫνϟͷҰྫ  2. OpenTelemetry ͱ͸ gateway auth

    payment dispatcher search poll poll poll ໰୊ᶃ 
 search αʔϏεͰΤϥʔ͕ൃੜʂ ͜ΕͷݩʹͳͬͨΤϯυϢʔβʔͷϦ ΫΤετ͸ͲΕͩΖ͏ʁ
  11. • 0QFO5FMFNFUSZ5SBDFT͕ͳ͍ͱ͖ ◦ ෼ࢄΞʔΩςΫνϟͷҰྫ  2. OpenTelemetry ͱ͸ gateway auth

    payment dispatcher search poll poll poll ໰୊ᶃ 
 search αʔϏεͰΤϥʔ͕ൃੜʂ ͜ΕͷݩʹͳͬͨΤϯυϢʔβʔͷϦ ΫΤετ͸ͲΕͩΖ͏ʁ ໰୊ᶄ 
 ΞϓϦέʔγϣϯ͕஗͍... 
 ݪҼͱͳΔAPI͸Θ͔͕ͬͨɺ͍͍ͬͨ Ͳ͜ͷϚΠΫϩαʔϏε͕ݪҼͳΜͩ Ζ͏͔...ʁ
  12. • 0QFO5FMFNFUSZ5SBDFTΛར༻ͨ͠ՄࢹԽ  2. OpenTelemetry ͱ͸ https://opentelemetry.io/docs/concepts/observability-primer/#distributed-traces ܦա࣌ؒ ਌ࢠؔ܎ ղܾᶃ

    
 search αʔϏεͷ Τϥʔ͸਌ࢠؔ܎Λ ͨͲΔ͜ͱ͕Ͱ͖ ΔͷͰର৅ͷΤϯ υϢʔβʔͷϦΫ Τετ͕ͲΕ͔Θ ͔Δʂ
  13. • 0QFO5FMFNFUSZ5SBDFTΛར༻ͨ͠ՄࢹԽ  2. OpenTelemetry ͱ͸ https://opentelemetry.io/docs/concepts/observability-primer/#distributed-traces ܦա࣌ؒ ਌ࢠؔ܎ ղܾᶃ

    
 search αʔϏεͷ Τϥʔ͸਌ࢠؔ܎Λ ͨͲΔ͜ͱ͕Ͱ͖ ΔͷͰର৅ͷΤϯ υϢʔβʔͷϦΫ Τετ͕ͲΕ͔Θ ͔Δʂ ղܾᶄ 
 ԣ௕ͳϒϩοΫ(εύϯͱݺͿ)͕଎౓Ϙ τϧωοΫͱ͙͢Θ͔Δ
  14. • 0QFO5FMFNFUSZ5SBDFTͷجຊ֓೦ ◦ 4QBO ▪ ࣮ߦλεΫͷ୯Ґ ▪ τϨʔε͸εύϯ 4QBO Ͱߏ੒͞ΕΔ

    ◦ 5SBDFS ▪ 4QBOΛੜ੒͢Δ ▪ ϦΫΤετͳͲͷૢ࡞ͷ୯ҐͰੜ੒͞ΕΔ ◦ 5SBDFS1SPWJEFS ▪ 5SBDFSΛੜ੒͢Δ ▪ ΞϓϦέʔγϣϯͷىಈɾఀࢭͷϥΠϑαΠΫϧʹ߹ΘͤΔ͜ͱ͕ଟ͍ ◦ 5SBDFS&YQPSUFS ▪ 4QBOͷ৘ใͳͲΛαʔϏεʹ࿈ܞ͢ΔɻϕϯμґଘʹͳΔͷ͸ओʹ͜͜ͷྖҬ  2. OpenTelemetry ͱ͸
  15. • 4QBOͷಋೖϙΠϯτ ◦ ϚΠΫϩαʔϏεͷϘτϧωοΫ͕ؾʹͳΔ ▪ ˠ)551 H31$αʔόʔͰ4QBOΛ࡞੒ ◦ ετϨʔδ΁ͷΞΫηεͷϘτϧωοΫ͕ؾʹͳΔ ▪

    ˠ3%# 3FEJT ͳͲ΁ͷΞΫηεͷࡍͷΫϥΠΞϯτͰ4QBOΛ࡞੒ ◦ ΞϓϦέʔγϣϯͷಛఆͷϩδοΫͷ଎౓͕ؾʹͳΔ ▪ ˠ4QBOΛ࡞੒ ͖͞΄Ͳͷྫ  3. Go Ͱ OpenTelemetryೖ໳
  16. • ·ͱΊ ◦ 0QFO5FMFNFUSZ͸෼ࢄγεςϜͷτϨʔγϯάʹ໾ཱͭ ▪ ଎౓ϘτϧωοΫͷಛఆ΋͠΍͘͢ͳΔ ◦ 0QFO5FMFNFUSZ5SBDFTͷجຊ֓೦ ▪ 5SBDFS1SPWJEFS5SBDFS4QBO

    ▪ ΞϓϦέʔγϣϯϢʔβʔϦΫΤετϚΠΫϩαʔϏεͷॲཧ ◦ ֤छϥΠϒϥϦͷ0QFO5FMFNFUSZରԠ͸3FHJTUSZΛࢀߟʹ͢Δͱྑ͍ ▪ ͦͷ··࢖͑Δ෦෼΋ଟ͍ ▪ 5SBDFS 4QBOͷѻ͍΋ֶ΂Δ  4. ·ͱΊ