promethues集成nomad
生活随笔
收集整理的這篇文章主要介紹了
promethues集成nomad
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
? ? ? ?在上一篇文章《prometheus獲取Consul上注冊的服務》里,已說明了如何將promethues集成consul,而nomad也可以集成到promethues中去,不廢話,直接上配置文件prometheus.yml內容:
# my global config global:scrape_interval: 15s # Set the scrape interval to every 15 seconds. Default is every 1 minute.evaluation_interval: 15s # Evaluate rules every 15 seconds. The default is every 1 minute.# scrape_timeout is set to the global default (10s).# Alertmanager configuration alerting:alertmanagers:- static_configs:- targets:- 10.110.200.68:9093# Load rules once and periodically evaluate them according to the global 'evaluation_interval'. rule_files:# - "first_rules.yml"# - "second_rules.yml"# A scrape configuration containing exactly one endpoint to scrape: # Here it's Prometheus itself. scrape_configs:# The job name is added as a label `job=<job_name>` to any timeseries scraped from this config.- job_name: 'prometheus'# metrics_path defaults to '/metrics'# scheme defaults to 'http'.static_configs:- targets: ['localhost:9090']- job_name: 'nomad-client'metrics_path: /v1/metricsparams: format: - prometheusconsul_sd_configs:- server: '10.110.200.184:8500'services: - nomad-client- job_name: consulconsul_sd_configs:- server: '10.110.200.40:8500'relabel_configs:- source_labels: [__meta_consul_tags]regex: .*,prometheus,.*action: keep- source_labels: [__meta_consul_service]target_label: job- source_labels: [__meta_consul_tags] regex: .*,smartms,.*target_label: __metrics_path__ replacement: '/actuator/prometheus'- source_labels: [__meta_consul_tags] regex: .*,type=([^,]+),.*target_label: type replacement: ${1}- source_labels: [__meta_consul_tags] regex: .*,env=([^,]+),.*target_label: env replacement: ${1}- source_labels: [__meta_consul_tags] regex: .*,app_id=([^,]+),.*target_label: app_id replacement: ${1}可以在targets界面看到nomad-client的情況
在metrics就能選到nomad的相關指標了
總結
以上是生活随笔為你收集整理的promethues集成nomad的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Consul入门07 - Consul
- 下一篇: 佛系程序员的月薪五万指南