Rancher1.6 部署prometheus

一、rancher基礎配置

鏡像:prom/prometheus:latest

映射端口:9090:9090

服務連接:

blackbox-exporter

cadvisor

node-exporter

掛載卷:

/home/work/prometheus:/etc/prometheus/

調度:

monitor=true

二、配置文件掛載

需要修改監聽機器IP:

prometheus.yml
global:
  scrape_interval:     15s
  evaluation_interval: 15s
  external_labels:
      monitor: 'exporter-metrics'
 
alerting:
  alertmanagers:
    - static_configs:
      - targets: ["alertmanager:9093"]
 
# Settings related to the remote write feature.
remote_write:
  - url: "
 
remote_read:
 
scrape_configs:
 
- job_name: 'HostsMetrics'
  dns_sd_configs:
  - names:
    - node-exporter
    refresh_interval: 15s
    type: A
    port: 9100
 
 
- job_name: 'RancherServerMetrics'
  dns_sd_configs:
  - names:
    - cadvisor
    refresh_interval: 15s
    type: A
    port: 8080
 
- job_name: 'RancherApi'
  dns_sd_configs:
  - names:
    - 'prometheus-rancher-exporter'
    refresh_interval: 15s
    type: A
    port: 9173
 
- job_name: 'Prometheus'
  static_configs:
    - targets:
      - '127.0.0.1:9090'
 
- job_name: 'ng_02blackbox'
  metrics_path: /probe
  params:
    module: [http_2xx]  # Look for a HTTP 200 response.
  static_configs:
    - targets:
      - http://www.baidu.co    # Target to probe with http.
      - https://www.baidu.co   # Target to probe with https.
  relabel_configs:
    - source_labels: [__address__]
      target_label: __param_target
    - source_labels: [__param_target]
      target_label: instance
    - target_label: __address__
      replacement: 10.116.1.157:9115  # The blackbox exporter's real hostname:port.
 
- job_name: 'ng_01blackbox'
  metrics_path: /probe
  params:
    module: [http_2xx]  # Look for a HTTP 200 response.
  static_configs:
    - targets:
      - http://www.baidu.co    # Target to probe with http.
      - https://www.baidu.co   # Target to probe with https.
 
  relabel_configs:
    - source_labels: [__address__]
      target_label: __param_target
    - source_labels: [__param_target]
      target_label: instance
    - target_label: __address__
      replacement: 10.116.1.155:9115  # The blackbox exporter's real hostname:port.
 
- job_name: 'uc-upstream'
  metrics_path: /probe
  params:
    module: [http_2xx]  # Look for a HTTP 200 response.
  static_configs:
    - targets:
      - http://10.116.1.157:2500/uc/_monitor
      - http://10.116.1.155:2500/uc/_monitor
  relabel_configs:
    - source_labels: [__address__]
      target_label: __param_target
    - source_labels: [__param_target]
      target_label: instance
    - target_label: __address__
      replacement: 10.116.1.155:9115  # The blackbox exporter's real hostname:port.
 
 
- job_name: 'ng_02port_status'
  metrics_path: /probe
  params:
    module: [tcp_connect]
  static_configs:
    - targets: ['127.0.0.1:443','127.0.0.1:80','10.116.1.155:2500','10.116.1.157:2500','10.116.1.155:3100','10.116.1.157:3100','10.116.1.157:4080','10.116.1.155:4090','10.116.1.155:4410','10.116.1.155:1101','10.116.1.157:1101']
      labels:
        instance: 'port_status'
        group: 'tcp'
  relabel_configs:
    - source_labels: [__address__]
      target_label: __param_target
    - target_label: __address__
      replacement: 10.116.1.157:9115
 
 
- job_name: 'ng_01port_status'
  metrics_path: /probe
  params:
    module: [tcp_connect]
  static_configs:
    - targets: ['127.0.0.1:443','127.0.0.1:80','10.116.1.155:2500','10.116.1.157:2500','10.116.1.155:3100','10.116.1.157:3100','10.116.1.157:4080','10.116.1.155:4090','10.116.1.155:4410','10.116.1.155:1101','10.116.1.157:1101']
      labels:
        instance: 'port_status'
        group: 'tcp'
  relabel_configs:
    - source_labels: [__address__]
      target_label: __param_target
    - target_label: __address__
      replacement: 10.116.1.155:9115
 
- job_name: 'kafka_exporter'
  static_configs:
  - targets: ['10.116.1.156:9308']
 
- job_name: 'jmx_exporter'
  static_configs:
  - targets: ['10.116.1.156:9309']

 

posted on 2020-07-06 20:42  一木浮生  閱讀(...)  評論(...編輯  收藏

導航

色网站直播