Grafana dashboard: DNS Masq
Description: Dashboard of dnsmasq statistic

### On Dashboard:
* Internal dnsmasq stats (evictions, hits, auth, insections and misses queries)
* Upstream queries
* Upstream errors

#### Requirement: python-dnspython

grafana->graphite->collectd

{
  "__inputs": [
    {
      "name": "DS_RCO",
      "label": "Graphite",
      "description": "graphite datasource",
      "type": "datasource",
      "pluginId": "graphite",
      "pluginName": "Graphite"
    },
    {
      "name": "VAR_PREFIX",
      "type": "constant",
      "label": "prefix",
      "value": "rco.collectd",
      "description": "prefix of collectd write_graphite plugin"
    }
  ],
  "__requires": [
    {
      "type": "grafana",
      "id": "grafana",
      "name": "Grafana",
      "version": "7.1.3"
    },
    {
      "type": "panel",
      "id": "graph",
      "name": "Graph",
      "version": ""
    },
    {
      "type": "datasource",
      "id": "graphite",
      "name": "Graphite",
      "version": "1.0.0"
    }
  ],
  "annotations": {
    "list": [
      {
        "builtIn": 1,
        "datasource": "-- Grafana --",
        "enable": true,
        "hide": true,
        "iconColor": "rgba(0, 211, 255, 1)",
        "name": "Annotations & Alerts",
        "type": "dashboard"
      }
    ]
  },
  "description": "Dashboard of dnsmasq statistic",
  "editable": true,
  "gnetId": 12837,
  "graphTooltip": 1,
  "id": null,
  "iteration": 1597666678093,
  "links": [
    {
      "$$hashKey": "object:728",
      "asDropdown": true,
      "icon": "external link",
      "includeVars": true,
      "keepTime": true,
      "tags": [
        "menu"
      ],
      "targetBlank": false,
      "title": "main",
      "type": "dashboards"
    }
  ],
  "panels": [
    {
      "aliasColors": {},
      "bars": false,
      "dashLength": 10,
      "dashes": false,
      "datasource": "${DS_RCO}",
      "decimals": 0,
      "description": "- auth - The number of authoritative queries answered.\n- hits - The number of cache hits.\n- misses - The number of cache misses.\n- insertions - Тotal number of names that have been inserted into the cache.\n- evictions - The number of names which have had to removed from the cache before they expired in order to make room for new names.",
      "fieldConfig": {
        "defaults": {
          "custom": {}
        },
        "overrides": []
      },
      "fill": 1,
      "fillGradient": 0,
      "gridPos": {
        "h": 7,
        "w": 24,
        "x": 0,
        "y": 0
      },
      "hiddenSeries": false,
      "id": 2,
      "legend": {
        "alignAsTable": true,
        "avg": true,
        "current": true,
        "max": true,
        "min": true,
        "rightSide": true,
        "show": true,
        "total": true,
        "values": true
      },
      "lines": true,
      "linewidth": 1,
      "links": [],
      "nullPointMode": "null",
      "paceLength": 10,
      "percentage": false,
      "pluginVersion": "7.1.3",
      "pointradius": 5,
      "points": false,
      "renderer": "flot",
      "repeat": null,
      "repeatDirection": "h",
      "seriesOverrides": [],
      "spaceLength": 10,
      "stack": false,
      "steppedLine": false,
      "targets": [
        {
          "refCount": 0,
          "refId": "A",
          "target": "alias(nonNegativeDerivative($prefix.$vm.dns_masq.gauge-evictions), 'evictions')"
        },
        {
          "refCount": 0,
          "refId": "B",
          "target": "alias(nonNegativeDerivative($prefix.$vm.dns_masq.gauge-auth), 'auth')"
        },
        {
          "refCount": 0,
          "refId": "C",
          "target": "alias(nonNegativeDerivative($prefix.$vm.dns_masq.gauge-hits), 'hits')"
        },
        {
          "refCount": 0,
          "refId": "D",
          "target": "alias(nonNegativeDerivative($prefix.$vm.dns_masq.gauge-insertions), 'insertions')"
        },
        {
          "refCount": 0,
          "refId": "E",
          "target": "alias(nonNegativeDerivative($prefix.$vm.dns_masq.gauge-misses), 'misses')"
        }
      ],
      "thresholds": [],
      "timeFrom": null,
      "timeRegions": [],
      "timeShift": null,
      "title": "Internal dnsmasq stats",
      "tooltip": {
        "shared": true,
        "sort": 0,
        "value_type": "individual"
      },
      "type": "graph",
      "xaxis": {
        "buckets": null,
        "mode": "time",
        "name": null,
        "show": true,
        "values": []
      },
      "yaxes": [
        {
          "$$hashKey": "object:670",
          "decimals": 0,
          "format": "none",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": "0",
          "show": true
        },
        {
          "$$hashKey": "object:671",
          "format": "short",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": null,
          "show": false
        }
      ],
      "yaxis": {
        "align": false,
        "alignLevel": null
      }
    },
    {
      "aliasColors": {},
      "bars": false,
      "dashLength": 10,
      "dashes": false,
      "datasource": "${DS_RCO}",
      "decimals": 0,
      "description": "The number of queries sent to upstream.",
      "fieldConfig": {
        "defaults": {
          "custom": {}
        },
        "overrides": []
      },
      "fill": 1,
      "fillGradient": 0,
      "gridPos": {
        "h": 7,
        "w": 24,
        "x": 0,
        "y": 7
      },
      "hiddenSeries": false,
      "id": 5,
      "legend": {
        "alignAsTable": true,
        "avg": true,
        "current": true,
        "max": true,
        "min": true,
        "rightSide": true,
        "show": true,
        "total": true,
        "values": true
      },
      "lines": true,
      "linewidth": 1,
      "links": [],
      "nullPointMode": "null",
      "paceLength": 10,
      "percentage": false,
      "pluginVersion": "7.1.3",
      "pointradius": 5,
      "points": false,
      "renderer": "flot",
      "repeatDirection": "h",
      "seriesOverrides": [],
      "spaceLength": 10,
      "stack": false,
      "steppedLine": false,
      "targets": [
        {
          "refCount": 0,
          "refId": "A",
          "target": "aliasByMetric(aliasSub(nonNegativeDerivative($prefix.$vm.dns_masq.gauge-upstream_*_queries), '^.*\\.gauge-upstream_(.*)_queries', '\\1'))",
          "textEditor": true
        }
      ],
      "thresholds": [],
      "timeFrom": null,
      "timeRegions": [],
      "timeShift": null,
      "title": "upstream queries",
      "tooltip": {
        "shared": true,
        "sort": 0,
        "value_type": "individual"
      },
      "type": "graph",
      "xaxis": {
        "buckets": null,
        "mode": "time",
        "name": null,
        "show": true,
        "values": []
      },
      "yaxes": [
        {
          "$$hashKey": "object:253",
          "decimals": 0,
          "format": "none",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": "0",
          "show": true
        },
        {
          "$$hashKey": "object:254",
          "format": "short",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": null,
          "show": false
        }
      ],
      "yaxis": {
        "align": false,
        "alignLevel": null
      }
    },
    {
      "aliasColors": {},
      "bars": false,
      "dashLength": 10,
      "dashes": false,
      "datasource": "${DS_RCO}",
      "decimals": 0,
      "description": "The number which resulted in an error.",
      "fieldConfig": {
        "defaults": {
          "custom": {}
        },
        "overrides": []
      },
      "fill": 1,
      "fillGradient": 0,
      "gridPos": {
        "h": 7,
        "w": 24,
        "x": 0,
        "y": 14
      },
      "hiddenSeries": false,
      "id": 6,
      "legend": {
        "alignAsTable": true,
        "avg": true,
        "current": true,
        "max": true,
        "min": true,
        "rightSide": true,
        "show": true,
        "total": true,
        "values": true
      },
      "lines": true,
      "linewidth": 1,
      "links": [],
      "nullPointMode": "null",
      "paceLength": 10,
      "percentage": false,
      "pluginVersion": "7.1.3",
      "pointradius": 5,
      "points": false,
      "renderer": "flot",
      "repeatDirection": "h",
      "seriesOverrides": [],
      "spaceLength": 10,
      "stack": false,
      "steppedLine": false,
      "targets": [
        {
          "refCount": 0,
          "refId": "A",
          "target": "aliasByMetric(aliasSub(nonNegativeDerivative($prefix.$vm.dns_masq.gauge-upstream_*_errors), '^.*\\.gauge-upstream_(.*)_errors', '\\1'))",
          "textEditor": true
        }
      ],
      "thresholds": [],
      "timeFrom": null,
      "timeRegions": [],
      "timeShift": null,
      "title": "upstream errors",
      "tooltip": {
        "shared": true,
        "sort": 0,
        "value_type": "individual"
      },
      "type": "graph",
      "xaxis": {
        "buckets": null,
        "mode": "time",
        "name": null,
        "show": true,
        "values": []
      },
      "yaxes": [
        {
          "$$hashKey": "object:464",
          "decimals": 0,
          "format": "none",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": "0",
          "show": true
        },
        {
          "$$hashKey": "object:465",
          "format": "short",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": null,
          "show": false
        }
      ],
      "yaxis": {
        "align": false,
        "alignLevel": null
      }
    }
  ],
  "schemaVersion": 26,
  "style": "dark",
  "tags": [
    "collectd",
    "dns",
    "main"
  ],
  "templating": {
    "list": [
      {
        "current": {
          "value": "${VAR_PREFIX}",
          "text": "${VAR_PREFIX}",
          "selected": false
        },
        "hide": 2,
        "label": "prefix",
        "name": "prefix",
        "options": [
          {
            "value": "${VAR_PREFIX}",
            "text": "${VAR_PREFIX}",
            "selected": false
          }
        ],
        "query": "${VAR_PREFIX}",
        "skipUrlSync": false,
        "type": "constant"
      },
      {
        "allValue": null,
        "current": {},
        "datasource": "${DS_RCO}",
        "definition": "$prefix.*",
        "hide": 0,
        "includeAll": false,
        "label": "vm",
        "multi": false,
        "name": "vm",
        "options": [],
        "query": "$prefix.*",
        "refresh": 1,
        "regex": "",
        "skipUrlSync": false,
        "sort": 0,
        "tagValuesQuery": "",
        "tags": [],
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      }
    ]
  },
  "time": {
    "from": "now-6h",
    "to": "now"
  },
  "timepicker": {
    "refresh_intervals": [
      "5s",
      "10s",
      "30s",
      "1m",
      "5m",
      "15m",
      "30m",
      "1h",
      "2h",
      "1d"
    ],
    "time_options": [
      "5m",
      "15m",
      "1h",
      "6h",
      "12h",
      "24h",
      "2d",
      "7d",
      "30d"
    ]
  },
  "timezone": "",
  "title": "DNS Masq",
  "uid": "dns_masq",
  "version": 20
}