- Newest
- Most votes
- Most comments
Hello Jakub,
Ensure that you have metrics data for the last three hours before running the query, otherwise it won't bring up any results.
As for the question "Why am I unable to use the query with two dimensions?", you can query with two dimensions with a condition. But first, check your CloudWatch metrics if they have been created as the default namespaces. RDS => DBInstanceIdentifier; RDS => Databaseclass; RDS => EngineName; RDS => Across All Databases. You see, when you query AWS/RDS then you can only go to one of the next level namespaces either DBInstanceIdentifier or Databaseclass or EngineName, etc.
However (here is the condition), if you have defined your own namespaces like RDS=> DBInstanceIdentifier/EngineName, then you can run query for both.
There is as an example with API usage examples in AWS documentation (https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/cloudwatch-metrics-insights-queryexamples.html#cloudwatch-metrics-insights-queryexamples-APIusage), it works with several namespaces, because metrics are reported under AWS/Usage => Class,Resource,Service,Type under one namespace.
Hope this helps.
Try this query without DBInstanceIdentifier in FROM SCHEMA:
SELECT AVG(CPUUtilization) FROM SCHEMA("AWS/RDS", EngineName) WHERE EngineName = 'mysql' GROUP BY DBInstanceIdentifier
Ensure that you have data for the last three hours available in CloudWatch. It is a current CloudWatch Query limitation - https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/cloudwatch-metrics-insights-limits.html
As for the label "Other" - "This means that the query includes a GROUP BY clause that specifies a label key that is not used in some of the metrics that are returned by the query. In this case, a null group named Other is returned." - https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/cloudwatch-metrics-insights-troubleshooting.html#cloudwatch-metrics-insights-troubleshooting-other
So what happened when you ran query: SELECT AVG(CPUUtilization) FROM "AWS/RDS" WHERE EngineName = 'mysql' GROUP BY DBInstanceIdentifier
By not specifying the SCHEMA, the query was running for the metrics, which do not have any dimensions but available in the namespace "AWS/RDS" (https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/cloudwatch-metrics-insights-querylanguage.html). That is why the query line "GROUP BY" could not find DBInstanceIdentifier and threw an error "Label": "Other".
Thanks for the answer. Unfortunately, the proposed query returns an empty result. Only queries with one dimension return the properly grouped results e.g.:
SELECT AVG(CPUUtilization) FROM SCHEMA("AWS/RDS", DBInstanceIdentifier) GROUP BY DBInstanceIdentifier
or
SELECT AVG(CPUUtilization) FROM SCHEMA("AWS/RDS", EngineName) GROUP BY EngineName
Why am I unable to use the query with two dimensions?
Relevant content
- asked a year ago
Thanks for the response, How can I define my custom namespace e.g. RDS=> DBInstanceIdentifier/EngineName? I am not able to find such an option in the AWS console.
My goal is to list all databases with values of a given metric. They should be filtered by a given database type. The result should be the same as for this query: SELECT AVG(CPUUtilization) FROM SCHEMA("AWS/RDS", DBInstanceIdentifier) GROUP BY DBInstanceIdentifier but additionally filtered by database type