azure - windows 导出器不从其他命名空间收集指标

标签 azure kubernetes prometheus azure-aks

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

最佳答案

您可以尝试以下步骤:

  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配置为远程写入 下面的根配置:

    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

关于azure - windows 导出器不从其他命名空间收集指标,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/70439618/

相关文章:

azure - 无法在西德区域创建 Azure 函数应用 - 该区域的配额为 0 个实例

将我的应用程序升级到 Asp.net Core 2.1.1 后,Azure 应用程序服务抛出 System.BadImageFormatException

kubernetes - 无法 ping 一个服务到 Kubernetes 集群中的另一个服务?

docker - 使用 WLS2 在 Docker 桌面上启用 Ingress Controller

spring-boot - Kubernetes、Spring Boot 和微服务

prometheus - promql 中有没有办法使用 thanos api 获取所有可用的标签名称?

sql - 在SQL Server中创建支持多语言排序规则的表

azure - Azure Key Vault 中的 AATL 文档签名证书

kubernetes - 使用 prometheus 计算 k8s 集群 cpu/内存使用情况

annotations - Kubernetes/Prometheus - 无法在服务文件中注释