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
Kazuki Obata
November 29, 2024
860
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
680
KubeCon + CloudNativeCon Japan 2025 Recap
donkomura
0
800
計装を見直してアプリケーションパフォーマンスを改善させた話
donkomura
2
490
自分だけの仮想クラスタを高速かつ効率的に作る kubefork
donkomura
0
320
ウォンテッドリーのインフラチームに加わってみて
donkomura
0
270
AWS CLI で気軽にコスト改善やってみた
donkomura
1
300
入門 KRR
donkomura
0
390
Featured
See All Featured
How to audit for AI Accessibility on your Front & Back End
davetheseo
0
400
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
Art, The Web, and Tiny UX
lynnandtonic
304
22k
A better future with KSS
kneath
240
18k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.7k
Designing for humans not robots
tammielis
254
26k
Writing Fast Ruby
sferik
630
63k
Leveraging LLMs for student feedback in introductory data science courses - posit::conf(2025)
minecr
1
280
Marketing to machines
jonoalderson
1
5.4k
How to Talk to Developers About Accessibility
jct
2
220
Jamie Indigo - Trashchat’s Guide to Black Boxes: Technical SEO Tactics for LLMs
techseoconnect
PRO
0
160
XXLCSS - How to scale CSS and keep your sanity
sugarenia
250
1.3M
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 ͷ͍ͯ͠ͳ͍ɺ͍ͬͯͳ͍ ࢄΒͬͨτϨʔεΛܨ͛Δ