Hello, I am trying to create alerts on a Grafana dashboard using some analytics from Prometheus. I have successfully been able to connect my Prometheus data source to Grafana and am able to view the data. I know that this is not an issue with how I am configuring alert rules in general or the server itself because I am receiving alerts related to other metrics in the same dashboard, and all of the data for every metric is showing up. I am specifically running into an issue with creating an alert related to the âupâ metric of Prometheus, which lets me know if my server is down.
-
What Grafana version and what operating system are you using?
Grafana Cloud, Windows -
What are you trying to achieve?
Trying to create an alert related to the âupâ metric of Prometheus in a Grafana dashboard. I am running Prometheus on my local machine and am using it to grab analytics from a website. -
How are you trying to achieve it?
Server address is blacked out in last images.
- What happened?
Received this error after using âtest ruleâ to test the alert rule for the up metric.
{
"firing": true,
"state": "pending",
"conditionEvals": " = true",
"timeMs": "5.406ms",
"error": "request handler error: Post \"http://localhost:9090/api/v1/query_range\": dial tcp [::1]:9090: connect: connection refused",
"logs": [
{
"message": "Condition[0]: Query",
"data": {
"from": blocked out,
"queries": [
{
"refId": "A",
"model": {
"exemplar": true,
"expr": "up{instance=\"blocked out\", job=\"server\"}",
"interval": "",
"legendFormat": "",
"queryType": "randomWalk",
"refId": "server"
},
"datasource": {
"id": 18,
"name": "Prometheus"
},
"maxDataPoints": 0,
"intervalMs": 0
}
],
"to": blocked out
}
}
]
}
-
What did you expect to happen?
I did not expect to receive an error and expected to be alerted that the server was down (as indicated by the â0â) in the graphic. -
Can you copy/paste the configuration(s) that you are having problems with?
Shown above. -
Did you receive any errors in the Grafana UI or in related logs? If so, please tell us exactly what they were.
Shown above.