Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
散らばったトレースを繋げる技術
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Kazuki Obata
November 29, 2024
890
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
散らばったトレースを繋げる技術
ゆるSRE勉強会 #8
https://yuru-sre.connpass.com/event/332731/
Kazuki Obata
November 29, 2024
More Decks by Kazuki Obata
See All by Kazuki Obata
ウォンテッドリーのアラート設計と Datadog 移行での知見
donkomura
0
730
KubeCon + CloudNativeCon Japan 2025 Recap
donkomura
0
910
計装を見直してアプリケーションパフォーマンスを改善させた話
donkomura
2
510
自分だけの仮想クラスタを高速かつ効率的に作る kubefork
donkomura
0
330
ウォンテッドリーのインフラチームに加わってみて
donkomura
0
290
AWS CLI で気軽にコスト改善やってみた
donkomura
1
310
入門 KRR
donkomura
0
410
Featured
See All Featured
The innovator’s Mindset - Leading Through an Era of Exponential Change - McGill University 2025
jdejongh
PRO
1
240
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
370
[SF Ruby Conf 2025] Rails X
palkan
2
1.3k
The Mindset for Success: Future Career Progression
greggifford
PRO
0
440
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
133
19k
The browser strikes back
jonoalderson
0
1.5k
The untapped power of vector embeddings
frankvandijk
2
1.8k
<Decoding/> the Language of Devs - We Love SEO 2024
nikkihalliwell
1
280
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.6k
My Coaching Mixtape
mlcsv
0
220
Building a Scalable Design System with Sketch
lauravandoore
463
34k
Prompt Engineering for Job Search
mfonobong
0
400
Transcript
© 2024 Wantedly, Inc. ࢄΒͬͨτϨʔεΛܨ͛Δٕज़ ΏΔSREษڧձ #8 LT Nov. 29
- Kazuki Obata / @donkomura_
© 2024 Wantedly, Inc. ͍ͨ͜͠ͱ - ΦϒβʔόϏϦςΟͷߏཁૉʮτϨʔεʯ - όϥόϥʹͳͬͯ͠·͏ͱࠔΔ -
ͱͳΔՕॴɾϙΠϯτΛղઆ - εύϯΛܨ͛ͯτϨʔεʹ͢Δํ๏Λհ - ίʔυϕʔεͰղઆ - ֶͼ
© 2024 Wantedly, Inc. APM ͰτϨʔεܨ͕Βͳ͍... - ىͬͨ͜͜ͱ - OpenCensus
ͱ dd-trace ͷτϨʔε͕όϥόϥ - ܭͨ͠τϨʔεͱ Redis ͷτϨʔε͕όϥόϥ - ༗ޮͳใ͕ͺͬͱݟΕͳ͍☹ - Ͳ͕͔͜ɺϘτϧωοΫʹͳ͍ͬͯΔ͔ҰͰ͔Βͳ͍ - εύϯ͕όϥόϥͰௐࠪͮ͠Β͍ https://docs.datadoghq.com/ja/tracing/glossary/
© 2024 Wantedly, Inc. ղܾࡦ τϨʔείϯςΩετΛ͢Δ
© 2024 Wantedly, Inc. τϨʔείϯςΩετΛ͢Δ - τϨʔείϯςΩετͱ - τϨʔεIDɾεύϯIDɾεύϯID Λ࣋ͬͨσʔλߏ
- ಉ͡τϨʔείϯςΩετ͔Βੜ͞Εͨεύϯಉ͡τϨʔεʹଐ͢Δ - ࢠؔҡ࣋͞ΕΔ - ͷݪҼ - TraceIDͷϑΥʔϚοτ͕ҟͳΔ - τϨʔείϯςΩετΛඞཁͳՕॴͰ͍͑ͯͳ͍ - ผʑͷτϨʔείϯςΩετΛ͍ͬͯͨ
© 2024 Wantedly, Inc. ͭͳ͛ํ 1. OpenCensus ͱ ddtrace ͷτϨʔεΛܨ͛Δ
Go (dd-trace-go) ͷྫ // ϑΥʔϚοτΛ͑Δ carrier := tracer.TextMapCarrier{ tracer.DefaultTraceIDHeader: strconv.FormatUint(binary.BigEndian.Uint64(traceID[8:]), 10), tracer.DefaultParentIDHeader: strconv.FormatUint(binary.BigEndian.Uint64(spanID[:]), 10), } // ίϯςΩετͷੜ sctx, _ := tracer.Extract(carrier) // εύϯͷੜ span, ctx := tracer.StartSpanFromContext(ctx, "op1", tracer.ChildOf(sctx)) // ctx ΛͬͯଞͷεύϯΛੜ span, ctx := tracer.StartSpanFromContext(ctx, "op2", tracer.ChildOf(sctx))
© 2024 Wantedly, Inc. ͭͳ͛ํ 2. Redis ͷτϨʔεΛܨ͛Δ Redigo ͷྫ
// Redis ΫϥΠΞϯτͷ Wrapper Λ͏ pool := &redis.Pool{ Dial: func() (redis.Conn, error) { return redigotrace.Dial("tcp", "127.0.0.1:6379", redigotrace.WithServiceName("my-redis-backend"), ) }, } // ίϯςΩετΛ͍ճ͢ c.Do("SET", "food", "cheese", ctx) https://pkg.go.dev/gopkg.in/DataDog/
[email protected]
/contrib/gomodule/redigo
© 2024 Wantedly, Inc. ·ͱΊ - ཁ͢ΔʹτϨʔείϯςΩετΛ͍·Θͤྑ͍ - ಉ͡τϨʔεIDΛ͏ -
εύϯͷࢠؔ - ܨ͕ͬͯͳ͍ͱ͖τϨʔεIDΛ֬ೝ - τϨʔεID͕ҟͳ͍ͬͯͳ͍͔ - e.g. ϑΥʔϚοτ͕ҧ͏ɺencode/decode ͕ؒҧ͍ͬͯΔ - τϨʔείϯςΩετͷ͕Ͱ͖͍ͯΔ͔ - e.g. ctx ͷ͍ͯ͠ͳ͍ɺ͍ͬͯͳ͍ ࢄΒͬͨτϨʔεΛܨ͛Δ