Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
散らばったトレースを繋げる技術
Search
Kazuki Obata
November 29, 2024
920
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
790
KubeCon + CloudNativeCon Japan 2025 Recap
donkomura
0
970
計装を見直してアプリケーションパフォーマンスを改善させた話
donkomura
2
520
自分だけの仮想クラスタを高速かつ効率的に作る kubefork
donkomura
0
350
ウォンテッドリーのインフラチームに加わってみて
donkomura
0
310
AWS CLI で気軽にコスト改善やってみた
donkomura
1
330
入門 KRR
donkomura
0
440
Featured
See All Featured
Lessons Learnt from Crawling 1000+ Websites
charlesmeaden
PRO
1
1.6k
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
1
340
Imperfection Machines: The Place of Print at Facebook
scottboms
270
14k
Introduction to Domain-Driven Design and Collaborative software design
baasie
1
1k
How to build a perfect <img>
jonoalderson
1
6.1k
SEO for Brand Visibility & Recognition
aleyda
0
4.8k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
28
3.7k
Leo the Paperboy
mayatellez
10
2.4k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
2.2k
Un-Boring Meetings
codingconduct
0
450
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
133
20k
[RailsConf 2023] Rails as a piece of cake
palkan
59
7.1k
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 ͷ͍ͯ͠ͳ͍ɺ͍ͬͯͳ͍ ࢄΒͬͨτϨʔεΛܨ͛Δ