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
AI 時代のスタートアップエコシステ厶から考究する技術的負債との向き合い方
m3m0r7
PRO
2
1.5k
30座EKS, 180次升級淬煉的EKS Upgrade Skill 的歷程
eric8230
0
130
アプリログインとWeb認証基盤をつなぐ ASWebAuthenticationSession 作法
shimastripe
1
310
Claude in Chrome 入門 / Introduction to Claude in Chrome
cielo1985
0
750
研究開発部の紹介 / Sansan R&D Profile
sansan33
PRO
5
25k
アプリをもっと"iOSアプリっぽく"する小さな工夫 / Small Touches That Make Your App Feel More Like an iOS App
matsuji
1
840
iOSDC Japan 2026 day1 TrackC 10:50
feedtailor
1
150
コスト最適化の「めんどくさい」を AWS FinOps Agent でチョット楽にする
classmethod_kaz
0
340
OpenTelemetry eBPF Instrumentationの舞台裏 / Behind the Scenes of OpenTelemetry eBPF Instrumentation
ymotongpoo
4
1.2k
GoにおけるFFIのこれまでとこれから
goccy
5
2.9k
20260912_スクラムにジェネラリストは必要か
ryugen04
0
400
作品が生態系になった ─ Mini Tokyo 3D から世界へ
nagix
0
180
Featured
See All Featured
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
56
3.5k
Rails Girls Zürich Keynote
gr2m
96
14k
Done Done
chrislema
186
16k
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
1
320
How to train your dragon (web standard)
notwaldorf
97
6.8k
SEO Brein meetup: CTRL+C is not how to scale international SEO
lindahogenes
1
2.9k
[RailsConf 2023] Rails as a piece of cake
palkan
59
7k
RailsConf 2023
tenderlove
30
1.5k
The Illustrated Children's Guide to Kubernetes
chrisshort
51
53k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
Java REST API Framework Comparison - PWX 2021
mraible
34
9.7k
DevOps and Value Stream Thinking: Enabling flow, efficiency and business value
helenjbeal
1
380
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/ 仲間募集中