Error when using Thresholds and No Value

Hey all, I’m running into an issue where a device is not marked as down (red in the threshold) when there is not any data. I do have the ‘No Value’ setting set to 100, and the threshold for a red ‘bad’ status is 99.

So when our monitoring software reports no value for the sensor, Grafana, as expected, fills it in as 100.

My issue is that it’s not reflected on the state timeline. In the above screenshot, the ‘ignore me’ device has been offline for about fifteen minutes, but Grafana reports it as up. Can you spot anything I’m doing wrong? Panel JSON is as follows:

{

  "id": 9,

  "gridPos": {

    "h": 10,

    "w": 24,

    "x": 0,

    "y": 27

  },

  "type": "state-timeline",

  "title": "Testing",

  "datasource": {

    "type": "jasonlashua-prtg-datasource",

    "uid": "hDm_4Al7k"

  },

  "pluginVersion": "8.5.2",

  "fieldConfig": {

    "defaults": {

      "custom": {

        "lineWidth": 0,

        "fillOpacity": 70,

        "spanNulls": true

      },

      "color": {

        "mode": "thresholds"

      },

      "mappings": [],

      "thresholds": {

        "mode": "absolute",

        "steps": [

          {

            "color": "red",

            "value": null

          },

          {

            "color": "green",

            "value": 0

          },

          {

            "color": "dark-red",

            "value": 99

          }

        ]

      },

      "noValue": "100"

    },

    "overrides": []

  },

  "options": {

    "mergeValues": true,

    "showValue": "never",

    "alignValue": "left",

    "rowHeight": 0.6,

    "legend": {

      "displayMode": "hidden",

      "placement": "bottom"

    },

    "tooltip": {

      "mode": "single",

      "sort": "none"

    }

  },

  "targets": [

    {

      "channel": {

        "name": "Ping Time"

      },

      "datasource": {

        "type": "jasonlashua-prtg-datasource",

        "uid": "hDm_4Al7k"

      },

      "device": {

        "name": "IgnoreMe"

      },

      "errors": {},

      "functions": [],

      "group": {

        "name": "Servers"

      },

      "hide": false,

      "options": {

        "filterProperty": {

          "name": "tags",

          "visible_name": "Tags"

        },

        "includeDeviceName": true,

        "includeSensorName": false,

        "invertChannelFilter": false,

        "mode": {

          "filterProperty": {},

          "name": "Metrics",

          "textProperty": {},

          "textValueFrom": {},

          "value": 1

        }

      },

      "raw": {

        "queryString": "",

        "uri": ""

      },

      "refId": "I",

      "sensor": {

        "name": "Ping"

      }

    },

    {

      "channel": {

        "name": "Ping Time"

      },

      "datasource": {

        "type": "jasonlashua-prtg-datasource",

        "uid": "hDm_4Al7k"

      },

      "device": {

        "name": "dashboard.fnba.com"

      },

      "errors": {},

      "functions": [],

      "group": {

        "name": "New Stuff in 172.29.3.x"

      },

      "hide": false,

      "options": {

        "filterProperty": {

          "name": "tags",

          "visible_name": "Tags"

        },

        "includeDeviceName": true,

        "includeSensorName": false,

        "invertChannelFilter": false,

        "mode": {

          "filterProperty": {},

          "name": "Metrics",

          "textProperty": {},

          "textValueFrom": {},

          "value": 1

        }

      },

      "raw": {

        "queryString": "",

        "uri": ""

      },

      "refId": "G",

      "sensor": {

        "name": "Ping"

      }

    }

  ]

}

Thank you for your time and knowledge!

Ben

welcome to the :grafana: community @bentuttle!

I’m not sure that I fully understand, but I think this advice will be helpful anyway. Here’s what I understand:

  • When the sensor reports no data, the value should be substituted as 100 and you want the bar to turn red
  • When the sensor reports any data with a value less than 99, you want those datapoints on the state timeline to be green

I tried this with our TestDataDB and manually entered some data points and your panel json seems to work in my instance running Grafana 9.0.3. What version of Grafana are you using?

I see a lot of issues for null values with the state timeline that might be resolved in my version (beta):