Skip to content

"Status: 500. Message: unknown OpenSearch error response" when trying to do any sort of aggregation in grafana #400

Description

@danfinn

What happened:
We have a grafana instance connected to an AWS OpenSearch cluster. We can view metrics with this however whenever we try to create any sort of simple aggregation with the data we get a generic opensearch error. There are no errors being logged on our opensearch cluster and there are no 500s being reported. The error that grafana is logging every time this happens is:

logger=context userId=1 orgId=1 uname=admin t=2024-05-29T13:44:46.453355732Z level=info msg="Request Completed" method=POST path=/api/ds/query status=400 remote_addr=192.168.128.115 time_ms=9636 duration=9.636188649s size=192 referer="https://grafana.bcdemas.local/explore?orgId=1&panes=%7B%22Qv8%22%3A%7B%22datasource%22%3A%22e3d933fa-bf77-4cc0-baef-ba3ee6d4f9d1%22%2C%22queries%22%3A%5B%7B%22refId%22%3A%22A%22%2C%22datasource%22%3A%7B%22type%22%3A%22grafana-opensearch-datasource%22%2C%22uid%22%3A%22e3d933fa-bf77-4cc0-baef-ba3ee6d4f9d1%22%7D%2C%22query%22%3A%22%22%2C%22queryType%22%3A%22lucene%22%2C%22alias%22%3A%22%22%2C%22metrics%22%3A%5B%7B%22id%22%3A%221%22%2C%22type%22%3A%22avg%22%2C%22field%22%3A%22system.cpu.iowait.pct%22%7D%5D%2C%22bucketAggs%22%3A%5B%7B%22type%22%3A%22date_histogram%22%2C%22id%22%3A%222%22%2C%22settings%22%3A%7B%22interval%22%3A%22auto%22%7D%2C%22field%22%3A%22%40timestamp%22%7D%5D%2C%22format%22%3A%22table%22%2C%22timeField%22%3A%22%40timestamp%22%7D%5D%2C%22range%22%3A%7B%22from%22%3A%22now-6h%22%2C%22to%22%3A%22now%22%7D%7D%7D&schemaVersion=1" handler=/api/ds/query

Initially we were getting the error that too many buckets were being created but I've had AWS increase our bucket limit and now this is what we are seeing.

Screenshot 2024-05-29 at 9 52 53 AM

I am on the latest grafana opensearch plugin, 2.15.3

What you expected to happen:
to be able to create simple aggregations on the data in opensearch

How to reproduce it (as minimally and precisely as possible):
do a Group By on any metric

Anything else we need to know?:

Environment:

  • Grafana version: 10.2.3
  • OpenSearch version: OpenSearch 2.9
  • Plugin version: 2.15.3

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status
    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions