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
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
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
synctest時代のhttptest Go 1.27で変わるHTTPサーバテストの裏側 / go conference2026 synctest and httptest
budougumi0617
1
2.8k
The Agent Builder Loop from Daily Work to OSS
minorun365
PRO
3
150
Tips for Building Useful Agent Skills
rstankov
0
110
WAF 運用改善の承認サイクル/SRE_BizReach_MIXI_1
visional_engineering_and_design
2
620
「図書館」という名前のままでいいのか -Code4Lib JAPANカンファレンス2026 アンカンファレンス報告- / Code4Lib JAPAN Conference 2026: Unconference Report
ykiyota
0
170
10Xに技術的負債をもたらした「2つの境界の歪み」その構造と解消への営み
10xinc
0
700
2026/09/10 Spring Bootから Jakarta EE/MicroProfileへの移行
megascus
0
350
Omarchy Quattro の日本語設定周り
simosako
2
170
株式会社シーエーシー エンジニア向け会社紹介資料
cac
0
57k
10分で知る最近のOmarchy
komagata
0
280
AI 時代のスタートアップエコシステ厶から考究する技術的負債との向き合い方
m3m0r7
PRO
0
430
Snowflakeで実現する全社横断の顧客の声(VOC)分析・活用基盤@Snowflake World Tour Tokyo 2026
yuto16
0
200
Featured
See All Featured
Getting science done with accelerated Python computing platforms
jacobtomlinson
2
480
BBQ
matthewcrist
89
10k
HDC tutorial
michielstock
2
860
The Organizational Zoo: Understanding Human Behavior Agility Through Metaphoric Constructive Conversations (based on the works of Arthur Shelley, Ph.D)
kimpetersen
PRO
0
450
Context Engineering - Making Every Token Count
addyosmani
9
1.1k
State of Search Keynote: SEO is Dead Long Live SEO
ryanjones
0
270
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
10
1.3k
Intergalactic Javascript Robots from Outer Space
tanoku
273
27k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
202
76k
New Earth Scene 8
popppiees
3
2.6k
Amusing Abliteration
ianozsvald
1
290
The Cost Of JavaScript in 2023
addyosmani
55
10k
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/ 仲間募集中