简体   繁体   English

如何在 Cloudwatch 中为 RDS 内存利用率创建自定义指标?

[英]How do I create a custom metric for RDS Memory Utilization in Cloudwatch?

I have Enhanced Monitoring turned on for one of my RDS database instances, and accordingly it is publishing messages to the Cloudwatch log group called "RDSOSMetrics" every 60 seconds.我为我的一个 RDS 数据库实例打开了增强监控,因此它每 60 秒将消息发布到名为“RDSOSMetrics”的 Cloudwatch 日志组。 I found this article on how to create custom metrics but it doesn't seem to be working.我找到了关于如何创建自定义指标的这篇文章,但它似乎不起作用。

I'm at the stage where I click "Create Metric Filter" but I'm not understanding the syntax to use for the Filter Pattern, as it seems everything I try to use resutls in this error:我正处于单击“创建指标过滤器”的阶段,但我不了解用于过滤器模式的语法,因为似乎我尝试在此错误中使用 resutls 的所有内容:

There is a problem with your filter pattern.您的过滤器模式有问题。 The error is: Invalid metric filter pattern错误是:无效的度量过滤器模式

One such example of a filter pattern I tried to use (but apparently is invalid) is the following:我尝试使用的过滤器模式的一个示例(但显然无效)如下:

{ $.memory.physAvailKb * 100 / $.memory.physTotKb }

How can I change this filter pattern to actually be valid?如何更改此过滤器模式以使其实际有效?

I don't think you can do calculation with a filter我不认为你可以用过滤器进行计算

For my understanding, what you can do is, create a filter with {$.memory.physAvailKb > 0}, value to report for that filter is $.memory.physAvailKb根据我的理解,您可以做的是,创建一个带有 {$.memory.physAvailKb > 0} 的过滤器,该过滤器的报告值为 $.memory.physAvailKb

Create another filter for {$.memory.physTotKb > 0} that report value of $.memory.physTotKb为 {$.memory.physTotKb > 0} 创建另一个过滤器,报告 $.memory.physTotKb 的值

After that, you can use MathMetric for your operations之后,您可以使用MathMetric进行操作

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM