Grafana dashboard: Per prefix traffic IPv6
Description: Per prefix IPv6 traffic based on FastNetMon Advanced Traffic Persistency 

Per prefix IPv6 traffic based on FastNetMon Advanced Traffic Persistency 

{
  "__inputs": [
    {
      "name": "DS_CLICKHOUSE",
      "label": "Clickhouse",
      "description": "",
      "type": "datasource",
      "pluginId": "vertamedia-clickhouse-datasource",
      "pluginName": "ClickHouse"
    }
  ],
  "__requires": [
    {
      "type": "grafana",
      "id": "grafana",
      "name": "Grafana",
      "version": "6.5.1"
    },
    {
      "type": "panel",
      "id": "graph",
      "name": "Graph",
      "version": ""
    },
    {
      "type": "datasource",
      "id": "vertamedia-clickhouse-datasource",
      "name": "ClickHouse",
      "version": "1.9.3"
    }
  ],
  "annotations": {
    "list": [
      {
        "builtIn": 1,
        "datasource": "-- Grafana --",
        "enable": true,
        "hide": true,
        "iconColor": "rgba(0, 211, 255, 1)",
        "name": "Annotations & Alerts",
        "type": "dashboard"
      }
    ]
  },
  "description": "Per prefix IPv6 traffic based on FastNetMon Advanced Traffic Persistency ",
  "editable": true,
  "gnetId": 11889,
  "graphTooltip": 0,
  "id": null,
  "iteration": 1583959927281,
  "links": [],
  "panels": [
    {
      "aliasColors": {},
      "bars": false,
      "dashLength": 10,
      "dashes": false,
      "datasource": "${DS_CLICKHOUSE}",
      "fill": 1,
      "fillGradient": 0,
      "gridPos": {
        "h": 9,
        "w": 12,
        "x": 0,
        "y": 0
      },
      "hiddenSeries": false,
      "id": 2,
      "legend": {
        "avg": false,
        "current": false,
        "max": false,
        "min": false,
        "show": true,
        "total": false,
        "values": false
      },
      "lines": true,
      "linewidth": 1,
      "links": [],
      "nullPointMode": "null",
      "options": {
        "dataLinks": []
      },
      "percentage": false,
      "pointradius": 5,
      "points": false,
      "renderer": "flot",
      "seriesOverrides": [],
      "spaceLength": 10,
      "stack": false,
      "steppedLine": false,
      "targets": [
        {
          "database": "fastnetmon",
          "dateColDataType": "packetDate",
          "dateLoading": false,
          "dateTimeColDataType": "packetDateTime",
          "dateTimeType": "DATETIME",
          "datetimeLoading": false,
          "format": "time_series",
          "formattedQuery": "SELECT $timeSeries as t, count() FROM $table WHERE $timeFilter GROUP BY t ORDER BY t",
          "groupBy": [
            {
              "params": [
                "$__interval"
              ],
              "type": "time"
            },
            {
              "params": [
                "null"
              ],
              "type": "fill"
            }
          ],
          "intervalFactor": 1,
          "orderByTime": "ASC",
          "policy": "default",
          "query": "$rate( sum(length * sampleRatio * 8) c)\nFROM $table\nWHERE\n    srcIpv6 BETWEEN tupleElement(IPv6CIDRToRange(toIPv6('$prefix'), $cidr), 1)\n    AND tupleElement(IPv6CIDRToRange(toIPv6('$prefix'), $cidr), 2)\n    OR dstIpv6 BETWEEN tupleElement(IPv6CIDRToRange(toIPv6('$prefix'), $cidr), 1)\n    AND tupleElement(IPv6CIDRToRange(toIPv6('$prefix'), $cidr), 2)",
          "rawQuery": "SELECT t, c/runningDifference(t/1000) cRate FROM ( SELECT (intDiv(toUInt32(packetDateTime), 20) * 20) * 1000 as t, sum(length * sampleRatio * 8) c FROM fastnetmon.traffic WHERE packetDate >= toDate(1538675200) AND packetDateTime >= toDateTime(1538675200) AND  ((srcIp >= IPv4StringToNum('8.8.8.0') AND srcIp <= IPv4StringToNum('8.8.8.0') + toUInt32(exp2(32-24))) or (dstIp >= IPv4StringToNum('8.8.8.0') AND dstIp <= IPv4StringToNum('8.8.8.0') + toUInt32(exp2(32-24)))) GROUP BY t ORDER BY t)",
          "refId": "A",
          "resultFormat": "time_series",
          "round": "0s",
          "select": [
            [
              {
                "params": [
                  "value"
                ],
                "type": "field"
              },
              {
                "params": [],
                "type": "mean"
              }
            ]
          ],
          "table": "traffic",
          "tableLoading": false,
          "tags": []
        }
      ],
      "thresholds": [],
      "timeFrom": null,
      "timeRegions": [],
      "timeShift": null,
      "title": "Total traffic",
      "tooltip": {
        "shared": true,
        "sort": 0,
        "value_type": "individual"
      },
      "type": "graph",
      "xaxis": {
        "buckets": null,
        "mode": "time",
        "name": null,
        "show": true,
        "values": []
      },
      "yaxes": [
        {
          "format": "bps",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        },
        {
          "format": "short",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        }
      ],
      "yaxis": {
        "align": false,
        "alignLevel": null
      }
    },
    {
      "aliasColors": {},
      "bars": false,
      "dashLength": 10,
      "dashes": false,
      "datasource": "${DS_CLICKHOUSE}",
      "fill": 1,
      "fillGradient": 0,
      "gridPos": {
        "h": 9,
        "w": 12,
        "x": 12,
        "y": 0
      },
      "hiddenSeries": false,
      "id": 3,
      "legend": {
        "avg": false,
        "current": false,
        "max": false,
        "min": false,
        "show": true,
        "total": false,
        "values": false
      },
      "lines": true,
      "linewidth": 1,
      "links": [],
      "nullPointMode": "null",
      "options": {
        "dataLinks": []
      },
      "percentage": false,
      "pointradius": 5,
      "points": false,
      "renderer": "flot",
      "seriesOverrides": [],
      "spaceLength": 10,
      "stack": false,
      "steppedLine": false,
      "targets": [
        {
          "database": "fastnetmon",
          "dateColDataType": "packetDate",
          "dateLoading": false,
          "dateTimeColDataType": "packetDateTime",
          "dateTimeType": "DATETIME",
          "datetimeLoading": false,
          "format": "time_series",
          "formattedQuery": "SELECT $timeSeries as t, count() FROM $table WHERE $timeFilter GROUP BY t ORDER BY t",
          "groupBy": [
            {
              "params": [
                "$__interval"
              ],
              "type": "time"
            },
            {
              "params": [
                "null"
              ],
              "type": "fill"
            }
          ],
          "intervalFactor": 1,
          "orderByTime": "ASC",
          "policy": "default",
          "query": "$rate( sum(length*sampleRatio*8) c) FROM $table \nWHERE \nsrcIpv6 BETWEEN tupleElement(IPv6CIDRToRange(toIPv6('$prefix'), $cidr),1) AND tupleElement(IPv6CIDRToRange(toIPv6('$prefix'), $cidr),2) OR\ndstIpv6 BETWEEN tupleElement(IPv6CIDRToRange(toIPv6('$prefix'), $cidr),1) AND tupleElement(IPv6CIDRToRange(toIPv6('$prefix'), $cidr),2)\n",
          "rawQuery": "SELECT t, c/runningDifference(t/1000) cRate FROM ( SELECT (intDiv(toUInt32(packetDateTime), 20) * 20) * 1000 as t, sum(length * sampleRatio * 8) c FROM fastnetmon.traffic WHERE packetDate >= toDate(1538675200) AND packetDateTime >= toDateTime(1538675200) AND  dstIp >= IPv4StringToNum('8.8.8.0') AND dstIp <= IPv4StringToNum('8.8.8.0') + toUInt32(exp2(32-24)) GROUP BY t ORDER BY t)",
          "refId": "A",
          "resultFormat": "time_series",
          "round": "0s",
          "select": [
            [
              {
                "params": [
                  "value"
                ],
                "type": "field"
              },
              {
                "params": [],
                "type": "mean"
              }
            ]
          ],
          "table": "traffic",
          "tableLoading": false,
          "tags": []
        }
      ],
      "thresholds": [],
      "timeFrom": null,
      "timeRegions": [],
      "timeShift": null,
      "title": "Outgoing traffic",
      "tooltip": {
        "shared": true,
        "sort": 0,
        "value_type": "individual"
      },
      "type": "graph",
      "xaxis": {
        "buckets": null,
        "mode": "time",
        "name": null,
        "show": true,
        "values": []
      },
      "yaxes": [
        {
          "format": "bps",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        },
        {
          "format": "short",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        }
      ],
      "yaxis": {
        "align": false,
        "alignLevel": null
      }
    },
    {
      "aliasColors": {},
      "bars": false,
      "dashLength": 10,
      "dashes": false,
      "datasource": "${DS_CLICKHOUSE}",
      "fill": 1,
      "fillGradient": 0,
      "gridPos": {
        "h": 9,
        "w": 12,
        "x": 12,
        "y": 9
      },
      "hiddenSeries": false,
      "id": 4,
      "legend": {
        "avg": false,
        "current": false,
        "max": false,
        "min": false,
        "show": true,
        "total": false,
        "values": false
      },
      "lines": true,
      "linewidth": 1,
      "links": [],
      "nullPointMode": "null",
      "options": {
        "dataLinks": []
      },
      "percentage": false,
      "pointradius": 5,
      "points": false,
      "renderer": "flot",
      "seriesOverrides": [],
      "spaceLength": 10,
      "stack": false,
      "steppedLine": false,
      "targets": [
        {
          "database": "fastnetmon",
          "dateColDataType": "packetDate",
          "dateLoading": false,
          "dateTimeColDataType": "packetDateTime",
          "dateTimeType": "DATETIME",
          "datetimeLoading": false,
          "format": "time_series",
          "formattedQuery": "SELECT $timeSeries as t, count() FROM $table WHERE $timeFilter GROUP BY t ORDER BY t",
          "groupBy": [
            {
              "params": [
                "$__interval"
              ],
              "type": "time"
            },
            {
              "params": [
                "null"
              ],
              "type": "fill"
            }
          ],
          "intervalFactor": 1,
          "orderByTime": "ASC",
          "policy": "default",
          "query": "$rate( sum(length*sampleRatio*8) c) FROM $table\nWHERE \nsrcIpv6 BETWEEN tupleElement(IPv6CIDRToRange(toIPv6('$prefix'), $cidr),1) AND tupleElement(IPv6CIDRToRange(toIPv6('$prefix'), $cidr),2) OR\ndstIpv6 BETWEEN tupleElement(IPv6CIDRToRange(toIPv6('$prefix'), $cidr),1) AND tupleElement(IPv6CIDRToRange(toIPv6('$prefix'), $cidr),2)\n",
          "rawQuery": "SELECT t, c/runningDifference(t/1000) cRate FROM ( SELECT (intDiv(toUInt32(packetDateTime), 20) * 20) * 1000 as t, sum(length * sampleRatio * 8) c FROM fastnetmon.traffic WHERE packetDate >= toDate(1538675200) AND packetDateTime >= toDateTime(1538675200) AND  srcIp >= IPv4StringToNum('8.8.8.0') AND srcIp <= IPv4StringToNum('8.8.8.0') + toUInt32(exp2(32-24)) GROUP BY t ORDER BY t)",
          "refId": "A",
          "resultFormat": "time_series",
          "round": "0s",
          "select": [
            [
              {
                "params": [
                  "value"
                ],
                "type": "field"
              },
              {
                "params": [],
                "type": "mean"
              }
            ]
          ],
          "table": "traffic",
          "tableLoading": false,
          "tags": []
        }
      ],
      "thresholds": [],
      "timeFrom": null,
      "timeRegions": [],
      "timeShift": null,
      "title": "Incoming traffic",
      "tooltip": {
        "shared": true,
        "sort": 0,
        "value_type": "individual"
      },
      "type": "graph",
      "xaxis": {
        "buckets": null,
        "mode": "time",
        "name": null,
        "show": true,
        "values": []
      },
      "yaxes": [
        {
          "format": "bps",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        },
        {
          "format": "short",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        }
      ],
      "yaxis": {
        "align": false,
        "alignLevel": null
      }
    }
  ],
  "schemaVersion": 21,
  "style": "dark",
  "tags": [],
  "templating": {
    "list": [
      {
        "allValue": null,
        "current": {
          "text": "2a00:1450:4009:816::200e",
          "value": "2a00:1450:4009:816::200e"
        },
        "hide": 0,
        "includeAll": false,
        "label": "Prefix",
        "multi": false,
        "name": "prefix",
        "options": [
          {
            "selected": false,
            "text": "8.8.8.0",
            "value": "8.8.8.0"
          }
        ],
        "query": "8.8.8.0",
        "skipUrlSync": false,
        "type": "custom"
      },
      {
        "allValue": null,
        "current": {
          "text": "128",
          "value": "128"
        },
        "hide": 0,
        "includeAll": false,
        "label": "CIDR",
        "multi": false,
        "name": "cidr",
        "options": [
          {
            "selected": false,
            "text": "24",
            "value": "24"
          }
        ],
        "query": "24",
        "skipUrlSync": false,
        "type": "custom"
      }
    ]
  },
  "time": {
    "from": "now-5m",
    "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": "Per prefix traffic IPv6",
  "uid": "JddzpHXZk",
  "version": 10
}