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
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
3k
Other Decks in Technology
See All in Technology
書き手が人でもAIでも正しくなる道、SREを埋め込んだDeveloper Platform / tech drivers day8
chmikata
4
850
Devin プロモコードの受け取りと適用(2026.10.27)
kinopeee
1
740
"計画的無茶振り"を通してAIネイティブ世代の新人を育てる
subroh0508
1
130
Claude Codeから見る、エンジニアの世界の変容とその先
oikon48
7
4.9k
Obsidian Vault Architectures
x5gtrn
PRO
0
210
アクセラレーターで実現するServiceNow活用の高速化 / ServiceNow World Forum 2026
visional_engineering_and_design
0
100
ドメインエキスパートは いかにして AI を使って プロダクト開発をするか
tatsuyashiraishi
1
240
「作れる」と「リリースできる」の間にあったもの── PdMを外して見えた、PdMがやるべき仕事/Buildable ≠ Shippable: What Removing the PM Taught Me About the PM’s Job
yappli_developers
0
390
なぜAI時代に技術記事を書くのか?どう書くのか? 〜bunの場合〜
kworkdev
PRO
0
1.1k
E2Eってつらくないですか?E2Eの管理コストを下げる手段とその実践
akaboshinit
6
2.8k
新米を「売り越さない」、Aurora DSQLで作る在庫ゼロ死守の限定ドロップEC
yama3133
0
110
Snowflake でできることが増えたら、 ABAC が必要になった
kaeton
0
120
Featured
See All Featured
コードの90%をAIが書く世界で何が待っているのか / What awaits us in a world where 90% of the code is written by AI
rkaga
63
47k
Applied NLP in the Age of Generative AI
inesmontani
PRO
4
2.5k
How to Talk to Developers About Accessibility
jct
2
600
The Curious Case for Waylosing
cassininazir
1
590
The Cost Of JavaScript in 2023
addyosmani
55
10k
Getting science done with accelerated Python computing platforms
jacobtomlinson
2
560
A brief & incomplete history of UX Design for the World Wide Web: 1989–2019
jct
2
550
Done Done
chrislema
187
17k
GitHub's CSS Performance
jonrohan
1033
470k
Reality Check: Gamification 10 Years Later
codingconduct
0
2.4k
Music & Morning Musume
bryan
48
7.5k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.6k
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/ 仲間募集中