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
Exponential Histogram?
Search
rmatsuoka
March 05, 2024
420
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Exponential Histogram?
OpenTelemetry Meetup 2024-02 - connpass
の LT で発表した資料です。
rmatsuoka
March 05, 2024
More Decks by rmatsuoka
See All by rmatsuoka
OpenTelemetry でゼロコード計装と手動計装どっちもやる
rmatsuoka
0
180
OpenTelemetry の Trace を中心としたパフォーマンス改善
rmatsuoka
1
2.6k
Featured
See All Featured
Mozcon NYC 2025: Stop Losing SEO Traffic
samtorres
1
250
Unsuck your backbone
ammeep
672
58k
Building Experiences: Design Systems, User Experience, and Full Site Editing
marktimemedia
0
520
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
220
Site-Speed That Sticks
csswizardry
13
1.2k
Lessons Learnt from Crawling 1000+ Websites
charlesmeaden
PRO
1
1.3k
Crafting Experiences
bethany
1
170
What the history of the web can teach us about the future of AI
inesmontani
PRO
1
600
Evolving SEO for Evolving Search Engines
ryanjones
0
210
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
160
Facilitating Awesome Meetings
lara
57
6.9k
Ten Tips & Tricks for a 🌱 transition
stuffmc
0
130
Transcript
Exponential Histogram? OpenTelemetry Meet Up 2024-02-15 id:rmatsuoka
id:rmatsuoka - 株式会社はてな - 2023年新卒!! - Mackerel - Application Engineer
Mackerel
Mackerel では OpenTelemetry の メトリクスへの対応を 進めています
OpenTelemetry のメトリクス形式 - Sum - Gauge - Histogram - Exponential
Histogram <- これなに?
Histogram!
ヒストグラムは何に使われているのか - HTTPレスポンスタイム - SQL のクエリにかかった時間 - GC が stop
the world した時間 - Span Metric Connector
Histogram のデータ形式 Bucket: []float ExplicitBounds: []float Timestamp: Time Bucket ExplicitBounds
度数分布表 より引用 実際にはもっとフィールドがある。このデータは概念的なもの。
Exponential Histogram?
Exponential Histogram が送ってくる データ形式 - Bucket: []float - Scale: int
- Timestamp: Time
(再掲) Histogram のデータ形式 - Bucket: []float - ExplicitBounds: []float -
Timestamp: Time
階級はどうやって計算される? s=Scale, Bucket の i-番目の Boundsは 上の数式で表される
Exponential Histogram で計装する - デフォルトでは Histogram として計装され る。 - Exponential
Histogram で計装するには設定 が必要 export OTEL_EXPORTER_OTLP_METRICS_DEFAULT_HISTOGRAM_AGGREGATION= BASE2_EXPONENTIAL_BUCKET_HISTOGRAM
Exponential Histogram は何が嬉しい - 階級(Scale) を自動に設定してくれる。 - 普通の Histogram では、自分で階級を設定する必要
がある - 試行錯誤がめんどくさい - 設定した階級がしょぼいと、パーセンタイルなどの誤 差が大きい(p99 が最大値を超えたり)
階級の設定の失敗例 https://opentelemetry.io/blog/2022/exponential-histograms/ から拝借
Histogram を保存するには? - Mackerel が対応しているメトリックの形式は Gauge, Sum など のスカラーな時系列 -
ただヒストグラムも使いたい! - Exponential Histogram は既存のデータ型とは異なって実装コス トが大変 - Gauge: {timestamp, float} - Exponential Histogram: {timestamp, float, []float}
Mackerel ではどう考えた? - Exponential Histogram の扱いは検討中 - 現状 p99 や
max などの代表値(スカラー)だけを保存する - Histogram に比べて Exponential Histogram の方がメリットが ある - 将来 Exponential Histogram が主流になりそう - 現実的には代表値で十分かも? - ヒストグラムのユースーケースをぜひ教えてください!