Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8.x.x Alerts still broken with 2.4.1 #400

Closed
derN3rd opened this issue Dec 28, 2021 · 2 comments · Fixed by #401
Closed

8.x.x Alerts still broken with 2.4.1 #400

derN3rd opened this issue Dec 28, 2021 · 2 comments · Fixed by #401

Comments

@derN3rd
Copy link

derN3rd commented Dec 28, 2021

Hey there,

Big thanks already to your changes to make the 8.x alerts working.
I've tried to build an alert on 8.3.3 with the plugin version 2.4.1 having the following data:

Screenshot 2021-12-28 at 20 19 12
Screenshot 2021-12-28 at 20 20 22

The shown query with configuration will result in the following error message:

Failed to evaluate queries and expressions: failed to execute conditions: failed to query data: Failed to query data: rpc error: code = Unknown desc = unable to parse json {\"database\":\"<redacted>_production\",\"dateColDataType\":\"event_time\",\"dateLoading\":false,\"dateTimeColDataType\":\"event_time\",\"dateTimeType\":\"DATETIME\",\"datetimeLoading\":false,\"extrapolate\":true,\"format\":\"time_series\",\"formattedQuery\":\"SELECT $timeSeries as t, count() FROM $table WHERE $timeFilter GROUP BY t ORDER BY t\",\"hide\":false,\"interval\":\"60\",\"intervalFactor\":1,\"intervalMs\":1000,\"maxDataPoints\":43200,\"query\":\"SELECT\\n $timeSeries as t,\\n count() as count_now\\nFROM $table\\n\\nWHERE event_time \\u003e $from AND event_time \\u003c $to\\n\\nGROUP BY t\\n\\nORDER BY t\\n\",\"rawQuery\":true,\"refId\":\"A\",\"round\":\"1m\",\"skip_comments\":true,\"table\":\"event_backend_pushnotification_send\",\"tableLoading\":false} into Query struct Error: json: cannot unmarshal string into Go struct field EvalQuery.interval of type int"

The EvalQuery.interval in question is "1m" in the request.
The request data is the following:

{
  "data": [
    {
      "refId": "A",
      "queryType": "",
      "relativeTimeRange": { "from": 900, "to": 0 },
      "datasourceUid": "GuhCg3N7z",
      "model": {
        "database": "<redacted>_production",
        "dateColDataType": "event_time",
        "dateLoading": false,
        "dateTimeColDataType": "event_time",
        "dateTimeType": "DATETIME",
        "datetimeLoading": false,
        "extrapolate": true,
        "format": "time_series",
        "formattedQuery": "SELECT $timeSeries as t, count() FROM $table WHERE $timeFilter GROUP BY t ORDER BY t",
        "hide": false,
        "interval": "60",
        "intervalFactor": 1,
        "intervalMs": 1000,
        "maxDataPoints": 43200,
        "query": "SELECT\n    $timeSeries as t,\n    count() as count_now\nFROM $table\n\nWHERE event_time > $from AND event_time < $to\n\nGROUP BY t\n\nORDER BY t\n",
        "rawQuery": true,
        "refId": "A",
        "round": "1m",
        "skip_comments": true,
        "table": "event_backend_pushnotification_send",
        "tableLoading": false
      }
    },
    {
      "refId": "D",
      "queryType": "",
      "relativeTimeRange": { "from": 0, "to": 0 },
      "datasourceUid": "-100",
      "model": {
        "conditions": [
          {
            "evaluator": { "params": [-0.3, 0.3], "type": "outside_range" },
            "operator": { "type": "and" },
            "query": { "params": ["A"] },
            "reducer": { "params": [], "type": "last" },
            "type": "query"
          }
        ],
        "datasource": "__expr__",
        "hide": false,
        "intervalMs": 1000,
        "maxDataPoints": 43200,
        "refId": "D",
        "type": "classic_conditions"
      }
    }
  ]
}

I tried it with the easiest example I could come up with, but its still failing.

Thanks in advance

@Slach Slach mentioned this issue Dec 29, 2021
@Slach
Copy link
Collaborator

Slach commented Dec 29, 2021

@derN3rd check https://github.com/Vertamedia/clickhouse-grafana/releases/tag/v2.4.2
feel free open separate issues if something not works on unified alerts

@derN3rd
Copy link
Author

derN3rd commented Dec 29, 2021

Perfect, works as expected now. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants