Singlestat panel with Prometheus data source does not update automatically

I’m setting up my first dashboard with a Singlestat panel. My data source is a Prometheus server. The metric to be shown is a simple “healthcheck”, i.e. the metric delivers a 0.0 if the endpoint is down and a 1.0 if the endpoint is up.

Here’s the configuration of the panel:


The problem is that I need to manually refresh the dashboard (or edit some options in the query). Only then the Singlestat panel shows the correct current value. The metric itself delivers the correct value. The query inspector also shows the correct data but it seems as if this is because opening the query inspector triggers a reload.

If I don’t trigger any update I can wait for “hours” but the panel does not reflect the current value.

Here’s the output of the query inspector:

{
  "xhrStatus": "complete",
  "request": {
    "method": "GET",
    "url": "api/datasources/proxy/1/api/v1/query?query=myproject_health_check_frontend&time=1557064692"
  },
  "response": {
    "status": "success",
    "data": {
      "resultType": "vector",
      "result": [
        {
          "metric": {
            "instance": "host.docker.internal:8090",
            "job": "myproject"
          },
          "value": [
            1557064692,
            "1"
          ]
        }
      ]
    }
  }
}

Show us the query please.

Show us the query please.

Sorry if I might be wrong but doesn’t my first screenshot show the query?

I meant SELECT blah, blah FROM etc...
Also, have you set a refresh interval in the dashboard time range dropdown?

1 Like

The metric is a custom one delivered from my Java application, i.e. it’s not a query like SELECT ... FROM ....

Ahhhh, I see… the refresh interval was disbled. The dashboard only show values from the last hour without any refreshing.

It works now :slight_smile: