首页 > 解决方案 > 通过 Prometheus Server 将自定义指标推送到 CloudWatch

问题描述

我正在研究 CloudWatch 代理,包括 Prometheus。我正在阅读以下教程 https://docs.amazonaws.cn/en_us/AmazonCloudWatch/latest/monitoring/ContainerInsights-Prometheus-Setup-configure.html#ContainerInsights-Prometheus-Setup-new-exporters。我在 prometheus-cwagentconfig 部分添加了一个 metric_declaration,如教程中所述。

"metric_declaration": [
  {
     "source_labels":[ "Service", "Namespace"],
     "label_matcher":"(.*node-exporter.*|.*kube-dns.*);kube-system",
     "dimensions":[
        ["Service", "Namespace"]
     ],
     "metric_selectors":[
        "^coredns_dns_request_type_count_total$"
     ]
  }
]

我的问题是如何使用 curl 构建 http Prometheous GW 请求以将指标传递给 cloudwatch?

标签: kubernetesprometheusamazon-cloudwatch

解决方案


推荐阅读