From 602d2a28b07ba09505f52886baff3b7d477fbce6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Allier?= <118757729+RaphaelAllier@users.noreply.github.com> Date: Wed, 27 Sep 2023 15:44:39 +0200 Subject: [PATCH] [AWSC] Add metrics to RDS enhanced monitoring (#697) * [AWSC] Add metrics to RDS enhanced monitoring * [AWSC] remove print statement --- .../lambda_function.py | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/aws/rds_enhanced_monitoring/lambda_function.py b/aws/rds_enhanced_monitoring/lambda_function.py index 82a92a37f..c24642ee2 100644 --- a/aws/rds_enhanced_monitoring/lambda_function.py +++ b/aws/rds_enhanced_monitoring/lambda_function.py @@ -228,6 +228,29 @@ def _process_rds_enhanced_monitoring_message(ts, message, account, region): host=host_id, ) + for disks_stats in message.get("disks", []): + disks_tag = [] + if "name" in disks_stats: + disks_tag.append("%s:%s" % ("name", disks_stats.pop("name"))) + for key, value in disks_stats.items(): + stats.gauge( + "aws.rds.disks.%s" % key, + value, + timestamp=ts, + tags=tags + disks_tag, + host=host_id, + ) + + if "system" in message: + for key, value in message["system"].items(): + stats.gauge( + "aws.rds.system.%s" % key, + value, + timestamp=ts, + tags=tags, + host=host_id, + ) + def extract_json_objects(input_string): """