Grafana Cloudwatch LogGroups Query Error

  • What Grafana version and what operating system are you using?
    Grafana Version 9.5.2. RHEL 7.
  • What are you trying to achieve?
    Attempting to run a query on log groups in cloudwatch in aws. This is in govcloud.
  • How are you trying to achieve it?
    I am attempting to use the Amazon Cloudwatch Logs Dashboard that comes with Grafana. The query I a running is
fields @timestamp, @message, @logStream, @log
| sort @timestamp desc
| limit 20

I also tried this query

fields @timestamp, @message |
 sort @timestamp desc |
 limit 20

I am able to use the dropdown in the query and select the log groups but the query fails.

  • What happened?
    I get a plugin downstream error and nothing populates. When reviewing the grafana logs in /var I see:
    Querying LogGroups by ARN is not supported.

  • What did you expect to happen?
    I expected Grafana to return the results of the log group query. I was able to do this in commercial aws. Wondering if this is a govcloud specific issue.

Were you able to find a solution to this?

I am experiencing the same issue and have been unable to find a solution thus far unless I manually modify the dashboard JSON to use the the Log Group name instead of the ARN.

@greglloydt3 What exactly did you modify in the JSON? because if I remove “arn” from this, I get “LogGroup cannot be empty” error

"logGroups": [
   {
      "accountId": "xxxxxx",
     "arn": "xxxxxxxx",
     "name": "/ecs/test/myapp"
  }
]

I am having the same issue with Grafana Enterprise (free) 10.1.2.

Figured this out, I think govcloud has a limitation where you can’t query by the arn and since grafana auto populates the log groups with the full arn it ends up failing when you select the checkbox for the log groups.

To work around this type in only the log group name in the box under the auto populated log groups and hit enter. You will then be able to run your query.

2 Likes

Your solution worked and reviewing the JSON the accountId was removed and the arn and name fields are the same in the JSON within the logGroups array.

Example

"logGroups": [
            {
              "arn": "/aws/lambda/my-lambda",
              "name": "/aws/lambda/my-lambda"
            }
          ],

I am getting same error , not able see any cloudwatch log

error : no query found

Query error No queries found

issues has been resolved. select log name in select log group name and press add detail and run queries.

This is it. Thank you!

Can you please give a screenshot for this workaround. I am not able to follow. Which is this box that you are referring to - in the panel? Sorry i am desperate to get a solution as i am facing the same issue. I have a req to have All which takes all other values. But when i select All from drop-down i get this plugin issue with 500 error code.