【问题标题】:windows exporter does not collect metrics from other namespaceswindows exporter 不会从其他命名空间收集指标
【发布时间】:2021-12-21 17:47:59
【问题描述】:

我有一个包含 Windows 和 Linux 节点和容器的 AKS 集群。对于 Linux,我通常使用 Prometheus 收集指标,但不显示 Windows 指标。我已经安装并配置了 windows_exporter https://github.com/prometheus-community/windows_exporter。指标出现在与 windows_exporter 相同命名空间中的 pod 上。你能帮我如何从其他命名空间收集矩阵吗?或建议如何最好地从 Windows AKS 节点和 Pod 收集指标。谢谢。

【问题讨论】:

  • 您可以参考此文档,它可能对您有所帮助:octopus.com/blog/…
  • 如果回答对您有帮助,请Accept it as an Answer,以便遇到相同问题的其他人可以找到此解决方案并解决他们的问题。

标签: azure kubernetes prometheus azure-aks


【解决方案1】:

您可以尝试以下步骤:

  1. 下载Windows-Exporter后, 在终端打开文件夹并运行:

    .\windows_exporter.exe --collectors.enabled "cpu,cs,logical_disk,os,system,net"
    
  2. Windows-Exporter 启动后,配置 Prometheus 通过在内添加以下内容来抓取导出器 scrapes_configs数组

      - job_name: "windows_exporter"
        static_configs:
          - targets: ["localhost:9182"]
    
  3. 现在,将 Prometheus 配置为 远程写入 下面在root config

    remote_write:
      - url: "https://<PROMETHEUS_SERVER_NAME>/prometheus/remote/write"
        tls_config:
          insecure_skip_verify: true
    
  4. 执行完上述步骤后,您就可以启动 Prometheus 如果您希望保留一天数据或保留数据 根据您的要求,您可以运行以下命令:

    prometheus.exe --storage.tsdb.retention.time=1d ##as per your requirement change 1d
    

参考:

Monitoring a Windows cluster with Prometheus – Sysdig

RahulKumarShaw-MT 建议您可以参考 How to export metrics from Windows Kubernetes nodes in AKS - Octopus Deployaidapsibr/aks-prometheus-windows-exporter

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2021-06-24
    • 1970-01-01
    • 1970-01-01
    • 2019-08-08
    • 2021-11-10
    • 1970-01-01
    • 2011-10-25
    相关资源
    最近更新 更多