Error:"request handler error: Post "prometheus:9090": unsupported protocol scheme "prometheus""

Hey!
I am getting an error while testing an “alert”.
Everything is fine with the graph, I receive data from Prometheus, but the alert does not pass the test, the full output is below.
Perhaps someone can help me.

{
  "firing": true,
  "state": "pending",
  "conditionEvals": " = true",
  "timeMs": "0.343ms",
  "error": "request handler error: Post \"prometheus:9090\": unsupported protocol scheme \"prometheus\"",
  "logs": [
    {
      "message": "Condition[0]: Query",
      "data": {
        "from": 1631168820842,
        "queries": [
          {
            "refId": "A",
            "model": {
              "exemplar": true,
              "expr": "health_ping{instance=\"sp-dev4.itenv.ru:8060\", job=\"sample_monitoring\"}",
              "interval": "",
              "legendFormat": "",
              "refId": "A"
            },
            "datasource": {
              "id": 1,
              "name": "Prometheus"
            },
            "maxDataPoints": 0,
            "intervalMs": 0
          }
        ],
        "to": 1631168880842
      }
    }
  ]
}

I am having the same issue, did you ever solve this @ivanadyuzhev?

Edit: I found the solution, there’s a bug in Grafana where if you do not start the URL for your data source with the protocol, e.g. http://, then your graphs will work but your alerts will not. So you just need to change your data source URL to http://prometheus:9090

2 Likes

This topic was automatically closed after 365 days. New replies are no longer allowed.