Trying to push custom metrics gathered by prometheus-operator and service monitors to AWS CloudWatch

时间:2019-04-05 21:49:13

标签: kubernetes prometheus amazon-cloudwatch prometheus-operator

I am running Service monitors to gather metrics from pods. Then with the help of the Prometheus operator, I am using serviceMonitorSelector to catch those metrics in Prometheus. I see those metrics in Prometheus being collected.

Now, I am trying to export those custom metrics from Prometheus to AWS Cloudwatch. Does anyone have any idea how to do that? The end result is to set and alerting system with the help of Zenoss on Cloudwatch.

1 个答案:

答案 0 :(得分:1)

您已经设置了prometheus-to-cloudwatch之类的内容。您可以在Kubernetes或任何服务器上运行它,然后使其刮擦与Prometheus刮擦的目标相同的目标。 (prometheus-to-cloudwatch从出口商或作为Prometheus客户端而不是Prometheus服务器中获取指标)

然后,您抓取的任何内容都会在Cloudwatch中显示为指标,然后您可以针对这些指标设置警报。对于Zenoss,您可以使用AWS ZenPack并从CloudWatch中读取指标。

Kubernetes Prometheus Operator自动在您的Kubernetes集群中刮擦服务,并在创建服务时动态刮擦它们,您可能会检查Prometheus动态刮擦的目标,以配置使用prometheus-cloudwatch刮擦的对象(或者您可以建立另一个运算符;一个从普罗米修斯到云的运算符,但这将需要时间/工作)

(也没有像Prometheus服务器那样刮到CloudWatch的东西)