Alert always complains about TypeError: e.groupBy is undefined

Hi,
I’m running grafana8 and influxdb2 and have trouble getting alerts to work.

This is my flux query A:

from(bucket: "MYBUCKET")
  |> range(start: v.timeRangeStart, stop: v.timeRangeStop)
  |> filter(fn: (r) =>
    r._measurement == "bfield" and
    r._field == "BY"
  )

and my alert condition is:

 WHEN avg () OF query (A, 1m, now) IS ABOVE 0

evaluated every 1m FOR 5m.

But whatever I do when I run Test rule I get the error:

TypeError: e.groupBy is undefined

This is the output of Test rule:

{
  "firing": false,
  "state": "no_data",
  "conditionEvals": "false = false",
  "timeMs": "244.384ms",
  "logs": [
    {
      "message": "Condition[0]: Query",
      "data": {
        "from": 1625241127369,
        "queries": [
          {
            "refId": "A",
            "model": {
              "hide": true,
              "query": "from(bucket: \"MYBUCKET\")\n  |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\n  |> filter(fn: (r) =>\n    r._measurement == \"bfield\" and\n    r._field == \"BY\"\n  )",
              "refId": "A"
            },
            "datasource": {
              "id": 1,
              "name": "InfluxDB-bfield"
            },
            "maxDataPoints": 0,
            "intervalMs": 0
          }
        ],
        "to": 1625241187369
      }
    },
    {
      "message": "Condition[0]: Query Result",
      "data": {
        "fromDataframe": true,
        "series": [
          {
            "name": "",
            "points": []
          }
        ]
      }
    },
    {
      "message": "Condition[0]: Eval: false, Metric: , Value: null",
      "data": null
    }
  ]
}

I am at a loss what this error refers to. Any ideas?

Thanks!

1 Like

I am seeing the same. I wonder if Influxdb2 will work with native alerts now. They just overhauled it to work better with Prometheus.

Im experiencing same issue, any luck solving these? @kramik1 @domuhe

Yes, for me, it was a simple issue with the right type of syntax. I forget it it wanted the r.field or the r[“field”] style. One worked over the other I believe. Let me know if that helps you.