我正在运行服务监视器以从 pod 收集指标。然后在 Prometheus 运算符的帮助下,我使用 serviceMonitorSelector 在 Prometheus 中捕获这些指标。我看到 Prometheus 中的这些指标正在被收集。
现在,我正在尝试将这些自定义指标从 Prometheus 导出到 AWS Cloudwatch。有谁知道该怎么做?最终结果是在 Zenoss on Cloudwatch 的帮助下设置和警报系统。
最佳答案
您设置了类似 prometheus-to-cloudwatch .你可以在 Kubernetes 或任何服务器上运行它,然后让它抓取与 Prometheus 抓取的目标相同的目标。 (prometheus-to-cloudwatch 从导出器或作为 Prometheus 客户端而不是从 Prometheus 服务器抓取指标)
然后,您抓取的任何内容都会在 Cloudwatch 中显示为指标,然后您可以在这些指标上设置警报。对于 Zenoss,您可以使用 AWS ZenPack并从 CloudWatch 读取指标。
Kubernetes Prometheus Operator自动抓取 Kubernetes 集群中的服务并在创建时动态抓取它们,您可能需要检查 Prometheus 动态抓取的目标以配置使用 prometheus-to-cloudwatch 抓取的内容(或者您可以构建另一个运算符(operator);a prometheus-to-cloudwatch 运算符(operator),但这需要时间/工作)
(CloudWatch 也没有 Prometheus 服务器的刮板之类的东西)
关于kubernetes - 尝试将 prometheus-operator 和服务监视器收集的自定义指标推送到 AWS CloudWatch,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55543778/