【问题标题】:Default Value Prometheus Label默认值 Prometheus 标签
【发布时间】:2019-01-29 10:44:26
【问题描述】:

如果标签是由客户设置的,我想为 Prometheus 标签设置默认值。

在配置文件中应该是怎样的

- job_name: cadvisor   ...

【问题讨论】:

    标签: prometheus


    【解决方案1】:

    这就是我的 prometheus.yml 中的内容。 '#' 后面的东西是注释。我的工作名称有破折号而不是空格。希望对您有所帮助。

    ---
    global:
      scrape_interval: 60s
      evaluation_interval: 60s
    
    scrape_configs:
      -
        job_name: 'My-Cluster-Label'  # My-Cluster-Label metrics
        scrape_interval: 60s
        metrics_path: /app/metrics
        static_configs:
          -
            targets: ['my_docker_host:19000',
                      'next_docker_host:19000',
                      'another_docker_host:19000']
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-01-22
      • 1970-01-01
      • 2023-04-06
      • 2021-07-07
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多