CloudWatch自定义指标未按预期运行 [英] CloudWatch custom metrics not working as expected

查看:128
本文介绍了CloudWatch自定义指标未按预期运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经毫无问题地基于发送到CloudWatch的一些日志文件创建了其他7个指标.

I had already created 7 other metrics based on some log files I send to CloudWatch with no problems.

前段时间,我们遇到了MongoDB连接问题,我通过日志确定了这一点,因此我想创建一个指标,以便可以基于该指标创建警报.我确实创建了指标,但是(当然)没有数据被馈送到该Metic中,因为不再存在"MongoError"消息.

Some time ago we had a problem with MongoDB connection, and I identified that through logs, so I'd like to create a Metric, so that I can create an Alarm based on it. I did create the Metric, but (of course) there are no data being fed into that Metic, because no more "MongoError" messages exists.

但这是否还意味着我什至无法访问指标"来创建警报?因为这就是现在正在发生的事情.只能在日志"的过滤器"部分中看不到度量标准",这将不允许我创建警报或创建图形或任何其他内容.

But does that also mean that I can't even access the Metric to create the Alarm? Because this is what is happening right now. The Metric cannot be seen anywhere, only in the "Filters" section of the Logs, which won't allow me to create Alarms or create graphics or anything.

我已经在AWS论坛上发布了此内容,但这通常无济于事.

I have already posted this on AWS forums but that usually doesn't help.

推荐答案

仅当根据自定义指标存储数据时,才会创建Amazon CloudWatch自定义指标.因此,您需要推送一个数据值以使其出现,然后才能创建警报.

An Amazon CloudWatch custom metric is only created when data is stored against the custom metric. Therefore, you'll need to push a data value to make appear and then you will be able to create an alarm.

您可以使用 AWS命令行界面(CLI)将一些数据推送到CloudWatch. :

You can push some data to CloudWatch with the AWS Command-Line Interface (CLI), eg:

aws cloudwatch put-metric-data --namespace MongoDB --metric-name errors --value 0

这篇关于CloudWatch自定义指标未按预期运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆