Cannot use some AWS Cloudwatch functions in query

  • What Grafana version and what operating system are you using?

Grafana v10.1.4 (a676a96d91)
Debian

  • What are you trying to achieve?

I want to have the EFS bandwidth percent usage thanks to these queries :

  • How are you trying to achieve it?

I have no problem to add the Cloudwatch metrics PermittedThroughput and MeteredIOBytes, but when I try to set (m1/1048576)/PERIOD(m1) I have an error.

Error is :
“metric request error: "ValidationError: Error in expression ‘queryfb003148d6a3456bb93bcaaf27a40534’: Unsupported operand type(s) for PERIOD: ‘[Array[TimeSeries]]’\n\tstatus code: 400, request id: 070e0d09-31f7-4345-8074-d94bd48723ac"”

I have the same error if I try to use function TIME_SERIES. I did not try others.

  • What happened?

I don’t understand why, because if I use another function like SUM, LAST, it works. Moreover in the field there is autocompletion and function PERIOD is proposed. All the functions in Use metric math - Amazon CloudWatch are proposed.

  • What did you expect to happen?

I want to use the function PERIOD

  • Can you copy/paste the configuration(s) that you are having problems with?

I can send code if needed, adding attachment is disable for new users :frowning:

  • Did you receive any errors in the Grafana UI or in related logs? If so, please tell us exactly what they were.

In UI, I get the error :
“metric request error: "ValidationError: Error in expression ‘queryfb003148d6a3456bb93bcaaf27a40534’: Unsupported operand type(s) for PERIOD: ‘[Array[TimeSeries]]’\n\tstatus code: 400, request id: 070e0d09-31f7-4345-8074-d94bd48723ac"”

m1 in your query is reference to another query, so you need also that m1 query in Grafana

I forgot to say that I’ve added these queries :

And then, it works well with MAX(m1), MIN(m1), FIRST(m1), and maybe others.
But it did not work with PERIOD(m1) or TIME_SERIES(m1), and maybe others.

I don’t understand why the error message said the function is not supported, while this is proposed in autocompletion, and someone (oh it’s you :slight_smile: ) make it works(The AWS Cloudwatch PERIOD function (in expression) 5x smaller in 24hrs time range - #6 by jangaraj)

I guess you need to specify dimensions in the query for m1

Indeed it did the trick ! It was required on m2 too. I guess for Math it is required, otherwise on basic query it tooks automatically the variable defined

Thanks a lot :+1: :muscle: