如何在其中创建 prometheus 和其他主机导出器指标的联合?

问题描述

  1. 有一个本地 prometheus、grafana,它是集群外的一个警报管理器,用于从各种导出器主机收集指标。

  2. 任务是在 k8s 中提升 prometheus slave 并从本地 prometheus 创建另一个联邦,这样它仍然可以从各种主机 + 与 prometheus slave 收集指标

  3. 问题如下, prometheus.yml 联盟看起来如何

这种配置是否可以接受?:

global:
  scrape_interval:     15s 
  evaluation_interval: 15s
 
alerting:
  alertmanagers:
    - scheme: http
      static_configs:
        - targets: ['alertmanager:9093']

rule_files:
        - '/etc/prometheus/alerts/*.yml'

scrape_configs:

  - job_name: 'prometheus'
    static_configs:
    - targets: ['localhost:9090']

# Federation jobs
  - job_name: 'federate_k8s'
    scrape_interval: 15s
    honor_labels: true
    metrics_path: '/federate'
    params:
      'match[]':
        - '{job="prometheus_k8s"}'
        - '{__name__=~"job:.*"}'
    static_configs:
    - targets: ['Slave Prometheus endpoint1']


  - job_name: node1
    static_configs:
    - targets: ['0.0.0.0:9100']

  - job_name: node2
    static_configs:
    - targets: ['0.0.0.0:9100']
....
....
....
.......

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)