Contents
  1. 1. play - node info metrics

Prometheus collects and stores its metrics as time series data

Components

play - node info metrics

  1. run exporter to generate metrics
  2. add config to server to listen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    scrape_configs:
    - job_name: 'node'

    # Override the global default and scrape targets from this job every 5 seconds.
    scrape_interval: 5s

    static_configs:
    - targets: ['192.168.56.105:8081', '192.168.56.105:8082']
    labels:
    group: 'production'

    - targets: ['localhost:8082']
    labels:
    group: 'canary'

定义了4中不同的指标类型(metric type):Counter(计数器)、Gauge(仪表盘)、Histogram(直方图)、Summary(摘要)。

Counter:只增不减的计数器
rate(http_requests_total[5m])
topk(10, http_requests_total)
Gauge:可增可减的仪表盘
node_memory_MemFree
delta(cpu_temp_celsius{host=”zeus”}[2h])