Adding Percentage Unit to AWS CloudWatch Gauge Display

0

Good afternoon, Dear,

I'm encountering an issue with AWS CloudWatch. I've created a dashboard that exposes the Freeablememory metric of an RDS in a gauge. However, I wasn't satisfied with just the free memory; I would like to display the percentage of memory occupied. So, I processed the data as follows:

m1 freeablememory e2 8e+9 (total RAM in bytes in scientific notation) + m1 e3 (m1/e2) * 100 (to obtain the percentage)

Indeed, it returned the value in percentage but does not display the unit %. How can I add it?

Looking forward to your response.

Thank you.

Paulo
asked 4 months ago367 views
1 Answer
2
Accepted Answer

Hi Paulo In the program language you need to modifying the dashboard, you can use the setWidgetMetricFormat API call.In the JSON used to define the widget, specify the format of the metric to include the "%" symbol.

"metrics": [ [ "AWS/RDS", "FreeableMemory", "DBInstanceIdentifier", "your-instance", { "id": "m1" } ], [ { "expression": "m1 / 8e+9 * 100", "label": "Memory Used (%)", "id": "e1", "unit": "Percent" } ] ],

profile picture
Jagan
answered 4 months ago
profile picture
EXPERT
reviewed 2 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions