普罗米修斯有多个目标

普罗米修斯有多个目标

本文介绍了普罗米修斯有多个目标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在Centos上配置了普罗米修斯,版本详细信息如下.

I've configured prometheus on Centos, version details are follows.

prometheus-2.5.0.linux-386

我在prometheus.yml配置文件上添加了两个目标,所有服务器节点导出器都在运行.配置如下,

I've added two targets on the prometheus.yml configuration file, all the servers node exporters are running. Config as follows,

    scrape_configs:
  - job_name: "node"
    scrape_interval: "15s"
    target_groups:
    - targets: ['192.168.x.x:9100','192.168.x.y:9100']

但是在Prometheus UI中,Tragets仅显示单个节点,而其他未显示.如果删除一个节点,则显示现有节点.如何监视多个节点.但是在Grafana仪表板中显示多个系列错误.

But in the prometheus UI Tragets only showing single node other is not showing. If I remove one node existing node is showing. How can I monitor multiple nodes. But in Grafana Dashboard shows Multiple Series Error.

推荐答案

我已经在prometheus.yml上配置了此配置

I've configured with this configurations on 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:
      # - alertmanager: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: 'node'

    # metrics_path defaults to '/metrics'
    # scheme defaults to 'http'.

    static_configs:
    - targets: ['192.168.x.x:9100']
    - targets: ['192.168.x.y:9100']
    - targets: ['192.168.x.z:9100']

这篇关于普罗米修斯有多个目标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-05 22:06