Showing a default value when target source is unavailable

  • What Grafana version and what operating system are you using?
    Grafana version: 11.1.4
    OS: Ubuntu

  • What are you trying to achieve?
    I have created a dashboard using a Canvas visualization. What I am trying to visualize is, if the node exporter is currently running or not.

  • How are you trying to achieve it?
    The data source is set to a Prometheus. I am currently using the PromQL query up{job=“node”}.

  • What happened?
    The query works as expected when the node exporter is running. My issue is when the server of the target node is down, I am unable to show an appropriate status. The element shows the default “Double click to set field”, as it cannot find the specified field.

  • What did you expect to happen?
    I modified the query to be up{job=“node”} OR on() vector(0). I expected it to show 0 for this use case.

  • Can you copy/paste the configuration(s) that you are having problems with?
    {
    “options”: {
    “1”: {
    “color”: “semi-dark-green”,
    “index”: 1,
    “text”: “Up”
    },
    “SPECIAL”: { # Special value for timeout
    “color”: “blue”,
    “index”: 2,
    “text”: “SPECIAL”
    }
    },
    “type”: “value”
    },
    I included similar mappings for 0, null/NaN values as well.

  • Did you receive any errors in the Grafana UI or in related logs? If so, please tell us exactly what they were.
    The error I get is context deadline exceeded (Client.Timeout exceeded while awaiting headers).

  • Did you follow any online instructions? If so, what is the URL?
    I did not find instructions relevant for my use case.