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
Custom Prometheus Exporterによる オブザーバビリティ拡張 / Ext...
Search
kohbis
May 10, 2025
Technology
310
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Custom Prometheus Exporterによる オブザーバビリティ拡張 / Extending observability with Custom Prometheus Exporter
大LT 2025 春 in Aizu
https://zli.connpass.com/event/351157/
kohbis
May 10, 2025
More Decks by kohbis
See All by kohbis
AIに丸投げしないトイル削減 / Eliminating Toil Without Leaving It All to AI
kohbis
4
1.1k
『家族アルバム みてね』における インシデント対応との向き合い方 / Approach incident response in Family Album
kohbis
2
470
Kubernetes環境周りの責任範囲をいい機会なので考える / Taking the Opportunity to Clarify Kubernetes Responsibilities
kohbis
2
460
『家族アルバム みてね』におけるAmazon EKSコストとの向き合い方 / Optimizing Amazon EKS Costs: The FamilyAlbum Case
kohbis
4
1.8k
潜在的課題探索活動の近況報告 / Exploration of latent challenges
kohbis
2
200
いま、あらためて考えてみるアカウント管理 with IaC / Account management with IaC
kohbis
3
1.2k
〜『世界中の家族のこころのインフラ』を目指して”次の10年”へ〜 SREが導いたグローバルサービスの信頼性向上戦略とその舞台裏 / Towards the Next Decade: Enhancing Global Service Reliability
kohbis
4
7.6k
Grafana MCP serverでなんかし隊 / Try Grafana MCP server
kohbis
0
1.1k
データベースで見る『家族アルバム みてね』の変遷 / The Evolution of Family Album Through the Lens of Databases
kohbis
5
1.6k
Other Decks in Technology
See All in Technology
越境するなら専門用語を使うな高校校歌 / If you wanna cross border, you shouldn't use jargon
vtryo
0
120
アリアドネの糸と、20年ごとの建て替え ── 長尾真『電子図書館』を、伊勢で読み直す / Rereading Makoto Nagao’s "Electronic Library" in Ise
ykiyota
0
160
Claude in Chrome 入門 / Introduction to Claude in Chrome
cielo1985
0
240
AIとペアプロを始める。人とのペアプロをやめる。ペアプロの良さを改めて知る。もっと好きになった。 / Rediscovering Pair Programming
honyanya
1
340
目の前の楽しいが人生を変える - コミュニティの螺旋の歩き方と楽しむコツ / change your life
soudai
PRO
4
430
リージョンの壁を越える、 ちょっと変わったAWSサービスの話
falken
PRO
1
310
AI 駆動 Terraform 開発/SRE_BizReach_MIXI_2
visional_engineering_and_design
4
2k
20260906 「AWS運用入門」著者が教える、運用業務への生成AI活用入門
masaruogura
0
260
株式会社シーエーシー エンジニア向け会社紹介資料
cac
0
57k
The Agent Builder Loop from Daily Work to OSS
minorun365
PRO
3
130
薬剤師(ドメインエキスパート)と一緒に育てる薬局向けAIアシスタント
kakehashi
PRO
2
150
omasushiというライブラリを作った
polidog
PRO
0
200
Featured
See All Featured
How to Talk to Developers About Accessibility
jct
2
540
<Decoding/> the Language of Devs - We Love SEO 2024
nikkihalliwell
1
320
The Director’s Chair: Orchestrating AI for Truly Effective Learning
tmiket
1
290
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
4.7k
How to make the Groovebox
asonas
2
2.4k
Making Projects Easy
brettharned
120
6.7k
Side Projects
sachag
456
43k
[SF Ruby Conf 2025] Rails X
palkan
2
1.4k
Docker and Python
trallard
47
4.2k
sira's awesome portfolio website redesign presentation
elsirapls
0
410
How to build a perfect <img>
jonoalderson
1
6k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
37
6.6k
Transcript
©MIXI Custom Prometheus Exporterによる オブザーバビリティ拡張 2025/05/10 大LT 2025 春 in
Aizu 株式会社MIXI みてね事業本部 みてねプラットフォーム部 SREグループ 杉本浩平
©MIXI 2 お話しすること • “オブザーバビリティ ” • Prometheus • Prometheus
Exporter • Custom Prometheus Exporterの実装
©MIXI 3 “オブザーバビリティ ” システムの出力を調査することによって内部の状態を測定する能力のこと ※1 4つの主要なデータタイプ( MELT) Metrics •
システムのパフォーマンスやリソース使用状況を定量的に示す数値データ Events • システム内で発生した特定の事象や状態変化を記録するデータ Logs • システムやアプリケーションの動作に関する詳細なテキスト記録 Traces • 分散システムにおけるリクエストの流れを追跡し、各サービス間のやり取りや処理時間を可視化するデー タ ※1 https://www.splunk.com/ja_jp/blog/devops/observability.html
©MIXI 4 Prometheus Prometheus collects and stores its metrics as
time series data. メトリクスを時系列データとして収集&保存する ※1 主なコンポーネント Prometheus Server • ターゲットからMetricsを収集して保存(他いろいろ) Service Discovery • ターゲットを自動的に検出 Exporter • システムやアプリケーションのMetricsをPrometheus Serverが収集できる形式で提供 Pushgateway • ライフサイクルが短いジョブからMetricsをプッシュ Alertmanager • Prometheus Serverから送信されるアラートを処理 ※1より引用 ※1 https://prometheus.io/docs/introduction/overview
©MIXI 5 Prometheus Exporter • いわゆる監視エージェントの役割 • 特定のシステムやアプリケーションをターゲットとし、メトリクスを収集し、 HTTPエンドポイントで公開 •
公式ドキュメントに記載されているだけでも200ほど • DBやクラウドサービスなど、あらゆるシステムやサービスに対応したPrometheus公式またはサードパーティ製 どのようなときに欲しくなる? 1. 利用しているソフトウェアがPrometheus形式のメトリクスを提供していない (例)MySQL server exporter, Redis exporter, 2. ホストマシンのシステムメトリクスを取得したい (例)Node/system metrics exporter, Windows exporter 3. ネットワーク機器や外部サービスを監視したい (例)SNMP exporter, Blackbox exporter 4. 独自アプリケーションやサービスを監視したい (例)クライアントライブラリで Expoterを自作 https://prometheus.io/docs/instrumenting/clientlibs/
©MIXI 6 Prometheusのメトリクス形式 1行目:# HELP メトリクスの説明文 2行目:# TYPE メトリクスの種類 3行目:メトリクス
この例では「HTTPメソッド x レスポンスコードごとのリクエスト数の変化を時系列的に追跡する」 ことが可能になる Prometheusのメトリクス形式でレスポンスを返却するエンドポイントを公開さえできれば ありとあらゆるシステムやアプリケーションの可視化や分析が可能になる
©MIXI 7 Custom Prometheus ExporterのRuby実装例(without client library) Prometheusのメトリクス形式の出力であればいい ので シンプルな実装でカスタムメトリクスを公開可能
1. メトリクスデータを Hash.new で初期化 2. ダミーデータを作成 • metrics += 1 で定期的に加算 3. webrickサーバーを起動 4. /metrics へのリクエストに、Prometheusのメトリクス形式のテ キストをレスポンス • # HELP を追加 • # TYPE を追加 • Hashのkey/valueを追加 ⬆ メトリクスの種類が増えただけ対応する必要がある
©MIXI 8 Custom Prometheus ExporterのRuby実装例(with client library) クライアントライブラリを使用すると簡単に作成可能 公式にはGo /
Java or Scala / Python / Ruby / Rustをサポート 1. Rubyのclientライブラリを使用 https://github.com/prometheus/client_ruby 2. レジストリを作成して、メトリクスを管理(in-memory) Counterメトリクスを定義 • GaugeやHistogramなどタイプがある https://prometheus.io/docs/concepts/metric_types 3. レジストリにCounterメトリクスを登録 4. ダミーデータを作成 • counter.increment で定期的に加算 5. webrickサーバーを起動 6. /metrics へのリクエストに、Prometheusのメトリクス形式のテ キストをレスポンス • クライアントライブラリが組み立ててくれる
©MIXI 9 業務で見ているもの(一部)
©MIXI “オブザーバビリティ ”に 思いを馳せてみるのもよいかも?
©MIXI