How to use prefixed dimension values with wildcard or variable with AWS Cloudwatch data source?

Hello,

we have had a working dashboard using an AWS Cloudwatch data source and it stopped working with the changes introduced in grafana 6.5. I’ve been trying to figure out ways to change our dashboard to get it working the way it was before to no avail.

The dashboard queries look like this:

Before 6.5 the resulting graph shows queue sizes for each customer selected in the variable $customer. Starting with 6.5 it doesn’t show anything anymore.

Then I tried to use a wildcard: QueueName = incident_store_*
That doesn’t work either.

When using QueueName = incident_store_actualcustomer it shows that customers graph, but that’s not a good solution as our customer list changes dynamically.

Then I tried to use an unprefixed wildcard: QueueName = *. That works, but we have many queues with different prefixes and we get a “Maximum Number of allowed metrics exceeded error” when the query runs, also we mix all kinds of queues that we don’t want to mix.

I went directly to CloudWatch to see what the query would need to look like to get at least QueueName = incident_store_* to work.
The query that works in CloudWatch shows:
SEARCH('{AWS/SQS,QueueName} MetricName="ApproximateNumberOfMessagesVisible" QueueName=incident_store_*', 'Maximum', 60)

It includes an additional QueueName in the first parameter. Is there any way to get grafana to come up with a query like that or to be able to write my own query by hand?

I hope this question makes soem sense, I’ll gladly supply additional info if needed.

Thank you very much!

Hey did you have any luck figuring out how to wildcard with a prefix? Same thing here, our resource names are dynamic so we need a way to target them generically.