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
Prometheus の relabeling
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Teraoka Yoshinori
June 03, 2019
Technology
19k
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Prometheus の relabeling
Teraoka Yoshinori
June 03, 2019
More Decks by Teraoka Yoshinori
See All by Teraoka Yoshinori
Job に挿入される sidecar を停止させる sidecar を挿入する話
yteraoka
0
200
What is the difference between docker and containerd about logging?
yteraoka
2
1.1k
GitLabサーバーのモニタリング / gitlab server monitoring
yteraoka
1
2.9k
Other Decks in Technology
See All in Technology
Meet AgentCore Identity Consent Portal
hironobuiga
3
190
自主式軟體工廠
philipz
0
240
AI時代だからこそ推したい!Gitコマンド再入門
munakata
0
150
DevelopersIO 2026 知識の地図を描く ─ オントロジーとは何か?
ishikawa_satoru
1
240
3つのアプローチで目指す チームを強くするAI駆動開発
thkt
0
120
事業活動を AI Ready にする攻めと守りのデータエンジニアリング / data-engineering-for-ai-ready-business
pei0804
5
1.9k
【データ横丁主催】AI Agentがコンテキストを使って仕事をした後、何が残るのか― 組織の経験を次の判断に引き継ぐ「Agent Memory」
shisyu_gaku
2
340
AIは爆速なのに、私が詰まっていた話 ― 音声入力と鳴くマスコットでボトルネックを削る
yama3133
0
530
全社共通データ基盤をつくる。ソニーのDatabricks活用とデータガバナンス設計の裏側
sony
0
430
自律型 AI をセキュアに実装!Gemini と MIG で作る動的コード実行環境
recruitengineers
PRO
1
220
AI時代に必要な脅威モデリング― 変化の速度に負けない理解とリスク判断
masakane55
5
1.2k
しろおびから始める!ログ活用の第一歩
shumei_ito
0
560
Featured
See All Featured
Hiding What from Whom? A Critical Review of the History of Programming languages for Music
tomoyanonymous
3
1.3k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
10k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
133
20k
Bioeconomy Workshop: Dr. Julius Ecuru, Opportunities for a Bioeconomy in West Africa
akademiya2063
PRO
1
390
Scaling GitHub
holman
464
140k
The Hidden Cost of Media on the Web [PixelPalooza 2025]
tammyeverts
2
510
The Limits of Empathy - UXLibs8
cassininazir
2
710
Rails Girls Zürich Keynote
gr2m
96
14k
Leo the Paperboy
mayatellez
10
2.4k
BBQ
matthewcrist
90
10k
Building Adaptive Systems
keathley
44
3.2k
Skip the Path - Find Your Career Trail
mkilby
1
240
Transcript
Prometheus の relabeling Prometheus Meetup Tokyo #2 2019.6.3
自己紹介 Name: Teraoka Yoshinori Twitter: yteraoka Github: yteraoka Blog: https://blog.1q77.com/
Job: SRE @ M3 https://jobs.m3.com/
エムスリーでの Prometheus • 2016年に Docker Swarm を導入し、しばらくは Zabbix でメトリクスを収集していた が、Zabbix
に慣れていないこともあり不便だったため2017年頭に Prometheus に切 り替えた • その後、物理・仮想サーバーへと拡大 • Cacti で5分間隔の polling を行っていたが、もっと高頻度(1分未満間隔)で取得し たかった • 可視化はもちろん Grafana ◦ Grafana の Alert を使ってグラフ付きで slack に投稿している • Alertmanager はまだ使っていない
使用している Exporter • cAdvisor • node_exorter • libvirt_exporter • postgres_exporter
• redis_exporter • memcached_exporter • elasticsearch_exporter • haproxy_exorter • jmx_exporter • oracledb_exporter これらの他に、SpringBoot アプリに Prometheus 用の actuator を入れてい たり、アプリがもつ既存のメトリクスエンド ポイントの出力を Prometheus 用に書き 換える Proxy を自作したりしています
話すことが無い... だいたい全部この本に書いてある 読みましょう 原著のリリースが2018年7月で、それより前に躓 いた話をします
導入時に躓いた話 • (旧) Docker Swarm で registrator を使って Consul にサービス情報を登録している
◦ このあたりのことは SlideShare にあります ◦ https://www.slideshare.net/yteraoka1 • Swarm クラスタ外の Prometheus からアクセスしたい • Consul だから consul_sd_configs を使えばそれで完了だと思ってた
導入時に躓いた話 • Consul から取得された target にはクラスタ内でしか通信できない Container のIP アドレス、ポートが __address__
にセットされていた これを書いていて気付きましたが Prometheus の Targets ページ (/targets) で label にポインタを乗せると Before relabeling という情報が表示される
導入時に躓いた話 Before relabeling: __address__="10.0.1.5:32791" ← クラスタ内からしかアクセスできないアドレス __meta_consul_address="172.16.0.100" ← クラスタ外からもアクセス可能なホストのアドレス __meta_consul_dc="dc1"
__meta_consul_node="docker-node2" __meta_consul_service="someapp" __meta_consul_service_address="10.0.1.5" __meta_consul_service_id="docker-node2:someapp_1:8080" __meta_consul_service_port="32791" __meta_consul_tags=",," __metrics_path__="/actuator/prometheus" __scheme__="http" job="someapp"
導入時に躓いた話 • Github で問い合わせた https://github.com/prometheus/prometheus/issues/2342
• Github で問い合わせた https://github.com/prometheus/prometheus/issues/2342 導入時に躓いた話 “You can use relabeling to
pull in the other address.” は??
導入時に躓いた話 • label って取ってきたメトリクスについてるものなんじゃないの? • target address を relabel ??
• と思いましたが、翌日には「ありがとう、解決したよ」って返してるからなんとかなっ たみたいです(もう覚えていない) • 「入門 Prometheus」を読んでおけばこんなことにはならないはず
導入時に躓いた話 - job_name: 'someapp' metrics_path: '/actuator/prometheus' consul_sd_configs: - server: '127.0.0.1:8500'
datacenter: 'dc1' services: - ‘someapp’ relabel_configs: - source_labels: ['__meta_consul_address', '__meta_consul_service_port'] separator: ':' regex: '(.*)' target_label: '__address__' replacement: '$1'
導入時に躓いた話 Before relabeling: __address__="10.0.1.5:32791" __meta_consul_address="172.16.0.100" ← コレと __meta_consul_dc="dc1" __meta_consul_node="docker-node2" __meta_consul_service="someapp"
__meta_consul_service_address="10.0.1.5" __meta_consul_service_id="docker-node2:someapp_1:8080" __meta_consul_service_port="32791" ← コレで __address__ を上書き __meta_consul_tags=",," __metrics_path__="/actuator/prometheus" __scheme__="http" job="someapp"
https://jobs.m3.com/ 仲間募集中