For some alerting and monitoring purpose, I am trying to fetch RDS cloudwatch metrics. There are around ~50 RDS instances and would like to fetch metrics for all of them in one API call(I am using boto3). This is my code :
response = cloudwatch_client.get_metric_data(
MetricDataQueries=[
{
'Id': 'fetching_data_for_something',
'MetricStat': {
'Metric': {
'Namespace': 'AWS/RDS',
'MetricName': 'FreeStorageSpace',
'Dimensions': [
{
'Name': 'DBInstanceIdentifier',
'Value': '*'
},
]
},
'Period': 300,
'Stat': 'Average'
},
'ReturnData': True
},
],
StartTime=datetime(2019, 6, 11,13,0,0),
EndTime=datetime(2019, 6, 11,13,20,00),
ScanBy='TimestampDescending',
MaxDatapoints=123
)
But this is returning an empty result, but when I am searching for a particular DB instance, it is returning the result. This is working :
'Dimensions': [
{
'Name': 'DBInstanceIdentifier',
'Value': 'name_of_db'
},
]
But, this isn't :
'Dimensions': [
{
'Name': 'DBInstanceIdentifier',
'Value': '*'
},
]
Is there any way to accomplish this? To get metrics for all DBs at once?