Grafana dashboard: FastNetMon Advanced TOP 10 ASNs
Description: FastNetMon Advanced TOP 10 ASNs

This dashboard can be used for tracking top-k ASNs for incoming and outgoing traffic using Clickhouse as metrics backend. 

{
  "__inputs": [
    {
      "name": "DS_CLICKHOUSE",
      "label": "Clickhouse",
      "description": "",
      "type": "datasource",
      "pluginId": "vertamedia-clickhouse-datasource",
      "pluginName": "ClickHouse"
    }
  ],
  "__requires": [
    {
      "type": "grafana",
      "id": "grafana",
      "name": "Grafana",
      "version": "7.3.7"
    },
    {
      "type": "panel",
      "id": "graph",
      "name": "Graph",
      "version": ""
    },
    {
      "type": "datasource",
      "id": "vertamedia-clickhouse-datasource",
      "name": "ClickHouse",
      "version": "2.0.1"
    }
  ],
  "annotations": {
    "list": [
      {
        "builtIn": 1,
        "datasource": "-- Grafana --",
        "enable": true,
        "hide": true,
        "iconColor": "rgba(0, 211, 255, 1)",
        "name": "Annotations & Alerts",
        "type": "dashboard"
      }
    ]
  },
  "description": "FastNetMon Advanced TOP 10 ASNs",
  "editable": true,
  "gnetId": 13727,
  "graphTooltip": 0,
  "id": null,
  "links": [],
  "panels": [
    {
      "aliasColors": {},
      "bars": false,
      "dashLength": 10,
      "dashes": false,
      "datasource": "${DS_CLICKHOUSE}",
      "fieldConfig": {
        "defaults": {
          "custom": {}
        },
        "overrides": []
      },
      "fill": 1,
      "fillGradient": 0,
      "gridPos": {
        "h": 6,
        "w": 24,
        "x": 0,
        "y": 0
      },
      "hiddenSeries": false,
      "id": 1,
      "legend": {
        "alignAsTable": true,
        "avg": false,
        "current": true,
        "max": false,
        "min": false,
        "rightSide": true,
        "show": true,
        "sideWidth": 200,
        "sort": "current",
        "sortDesc": true,
        "total": false,
        "values": true
      },
      "lines": true,
      "linewidth": 1,
      "links": [],
      "nullPointMode": "null",
      "options": {
        "alertThreshold": true
      },
      "percentage": false,
      "pluginVersion": "7.3.7",
      "pointradius": 5,
      "points": false,
      "renderer": "flot",
      "seriesOverrides": [],
      "spaceLength": 10,
      "stack": false,
      "steppedLine": false,
      "targets": [
        {
          "database": "fastnetmon",
          "dateColDataType": "metricDate",
          "dateLoading": false,
          "dateTimeColDataType": "metricDateTime",
          "dateTimeType": "DATETIME",
          "datetimeLoading": false,
          "dsType": "influxdb",
          "extrapolate": true,
          "format": "time_series",
          "formattedQuery": "<font color=\"darkcyan\">$columns</font>(<br />    host c,<br />    <font color=\"navajowhite\">sum</font>(bits_incoming) <font color=\"navajowhite\">length</font>)<br /><font color=\"darkorange\">FROM</font> <font color=\"darkcyan\">$table</font><br /><font color=\"darkorange\">WHERE</font> host <font color=\"darkorange\">in</font> (<br />    <font color=\"darkorange\">SELECT</font> host<br />    <font color=\"darkorange\">FROM</font><br />(<br />        <font color=\"darkorange\">SELECT</font><br />            host,<br />            <font color=\"navajowhite\">sum</font>(bits_incoming) <font color=\"darkorange\">as</font> <font color=\"navajowhite\">length</font><br />        <font color=\"darkorange\">FROM</font> <font color=\"darkcyan\">$table</font><br />        <font color=\"darkorange\">GROUP BY</font> host<br />        <font color=\"darkorange\">ORDER BY</font> <font color=\"navajowhite\">length</font> <font color=\"darkorange\">DESC</font><br />        <font color=\"darkorange\">LIMIT</font> <font color=\"cornflowerblue\">10</font><br />))",
          "groupBy": [
            {
              "params": [
                "$__interval"
              ],
              "type": "time"
            },
            {
              "params": [
                "null"
              ],
              "type": "fill"
            }
          ],
          "hide": false,
          "interval": "1s",
          "intervalFactor": 1,
          "orderByTime": "ASC",
          "policy": "default",
          "query": "$columns(\n    asn_number c,\n    sum(bits_incoming) length)\nFROM $table\nWHERE asn_number in (\n    SELECT asn_number\n    FROM\n(\n        SELECT\n            asn_number,\n            sum(bits_incoming) as length\n        FROM $table\n        WHERE $timeFilter \n        GROUP BY asn_number\n        ORDER BY length DESC\n        LIMIT 10\n))",
          "rawQuery": "SELECT t, groupArray((c, length)) AS groupArr FROM ( SELECT (intDiv(toUInt32(metricDateTime), 1) * 1) * 1000 AS t, asn_number c, sum(bits_incoming) length FROM fastnetmon.asn_metrics_ipv4 WHERE metricDate >= toDate(1611437064) AND metricDateTime >= toDateTime(1611437064) AND asn_number in (     SELECT asn_number     FROM (         SELECT             asn_number,             sum(bits_incoming) as length         FROM fastnetmon.asn_metrics_ipv4         WHERE metricDate >= toDate(1611437064) AND metricDateTime >= toDateTime(1611437064)          GROUP BY asn_number         ORDER BY length DESC         LIMIT 10 )) GROUP BY t, c ORDER BY t, c) GROUP BY t ORDER BY t",
          "refId": "A",
          "resultFormat": "time_series",
          "round": "0s",
          "select": [
            [
              {
                "params": [
                  "value"
                ],
                "type": "field"
              },
              {
                "params": [],
                "type": "mean"
              }
            ]
          ],
          "table": "asn_metrics_ipv4",
          "tableLoading": false,
          "tags": []
        }
      ],
      "thresholds": [],
      "timeFrom": null,
      "timeRegions": [],
      "timeShift": null,
      "title": "Incoming traffic",
      "tooltip": {
        "shared": false,
        "sort": 0,
        "value_type": "individual"
      },
      "transparent": true,
      "type": "graph",
      "xaxis": {
        "buckets": null,
        "mode": "time",
        "name": null,
        "show": false,
        "values": []
      },
      "yaxes": [
        {
          "format": "bps",
          "label": "MBPS IN",
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        },
        {
          "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_CLICKHOUSE}",
      "fieldConfig": {
        "defaults": {
          "custom": {}
        },
        "overrides": []
      },
      "fill": 1,
      "fillGradient": 0,
      "gridPos": {
        "h": 6,
        "w": 24,
        "x": 0,
        "y": 6
      },
      "hiddenSeries": false,
      "id": 3,
      "legend": {
        "alignAsTable": true,
        "avg": false,
        "current": true,
        "max": false,
        "min": false,
        "rightSide": true,
        "show": true,
        "sideWidth": 185,
        "sort": "current",
        "sortDesc": true,
        "total": false,
        "values": true
      },
      "lines": true,
      "linewidth": 1,
      "links": [],
      "nullPointMode": "null",
      "options": {
        "alertThreshold": true
      },
      "percentage": false,
      "pluginVersion": "7.3.7",
      "pointradius": 5,
      "points": false,
      "renderer": "flot",
      "seriesOverrides": [
        {
          "alias": "/./",
          "transform": "negative-Y"
        }
      ],
      "spaceLength": 10,
      "stack": false,
      "steppedLine": false,
      "targets": [
        {
          "database": "fastnetmon",
          "dateColDataType": "metricDate",
          "dateLoading": false,
          "dateTimeColDataType": "metricDateTime",
          "dateTimeType": "DATETIME",
          "datetimeLoading": false,
          "dsType": "influxdb",
          "extrapolate": true,
          "format": "time_series",
          "formattedQuery": "<font color=\"darkcyan\">$columns</font>(<br />    host c,<br />    <font color=\"navajowhite\">sum</font>(bits_incoming) <font color=\"navajowhite\">length</font>)<br /><font color=\"darkorange\">FROM</font> <font color=\"darkcyan\">$table</font><br /><font color=\"darkorange\">WHERE</font> host <font color=\"darkorange\">in</font> (<br />    <font color=\"darkorange\">SELECT</font> host<br />    <font color=\"darkorange\">FROM</font><br />(<br />        <font color=\"darkorange\">SELECT</font><br />            host,<br />            <font color=\"navajowhite\">sum</font>(bits_incoming) <font color=\"darkorange\">as</font> <font color=\"navajowhite\">length</font><br />        <font color=\"darkorange\">FROM</font> <font color=\"darkcyan\">$table</font><br />        <font color=\"darkorange\">GROUP BY</font> host<br />        <font color=\"darkorange\">ORDER BY</font> <font color=\"navajowhite\">length</font> <font color=\"darkorange\">DESC</font><br />        <font color=\"darkorange\">LIMIT</font> <font color=\"cornflowerblue\">10</font><br />))",
          "groupBy": [
            {
              "params": [
                "$__interval"
              ],
              "type": "time"
            },
            {
              "params": [
                "null"
              ],
              "type": "fill"
            }
          ],
          "hide": false,
          "interval": "1s",
          "intervalFactor": 1,
          "orderByTime": "ASC",
          "policy": "default",
          "query": "$columns(\n    asn_number c,\n    sum(bits_outgoing) length)\nFROM $table\nWHERE asn_number in (\n    SELECT asn_number\n    FROM\n(\n        SELECT\n            asn_number,\n            sum(bits_outgoing) as length\n        FROM $table\n        WHERE $timeFilter \n        GROUP BY asn_number\n        ORDER BY length DESC\n        LIMIT 10\n))",
          "rawQuery": "SELECT t, groupArray((c, length)) AS groupArr FROM ( SELECT (intDiv(toUInt32(metricDateTime), 1) * 1) * 1000 AS t, asn_number c, sum(bits_outgoing) length FROM fastnetmon.asn_metrics_ipv4 WHERE metricDate >= toDate(1611437072) AND metricDateTime >= toDateTime(1611437072) AND asn_number in (     SELECT asn_number     FROM (         SELECT             asn_number,             sum(bits_outgoing) as length         FROM fastnetmon.asn_metrics_ipv4         WHERE metricDate >= toDate(1611437072) AND metricDateTime >= toDateTime(1611437072)          GROUP BY asn_number         ORDER BY length DESC         LIMIT 10 )) GROUP BY t, c ORDER BY t, c) GROUP BY t ORDER BY t",
          "refId": "A",
          "resultFormat": "time_series",
          "round": "0s",
          "select": [
            [
              {
                "params": [
                  "value"
                ],
                "type": "field"
              },
              {
                "params": [],
                "type": "mean"
              }
            ]
          ],
          "table": "asn_metrics_ipv4",
          "tableLoading": false,
          "tags": []
        }
      ],
      "thresholds": [],
      "timeFrom": null,
      "timeRegions": [],
      "timeShift": null,
      "title": "Outgoing traffic",
      "tooltip": {
        "shared": false,
        "sort": 0,
        "value_type": "individual"
      },
      "transparent": true,
      "type": "graph",
      "xaxis": {
        "buckets": null,
        "mode": "time",
        "name": null,
        "show": true,
        "values": []
      },
      "yaxes": [
        {
          "$$hashKey": "object:1528",
          "format": "bps",
          "label": "MBPS OUT",
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        },
        {
          "$$hashKey": "object:1529",
          "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_CLICKHOUSE}",
      "fieldConfig": {
        "defaults": {
          "custom": {}
        },
        "overrides": []
      },
      "fill": 1,
      "fillGradient": 0,
      "gridPos": {
        "h": 6,
        "w": 24,
        "x": 0,
        "y": 12
      },
      "hiddenSeries": false,
      "id": 2,
      "legend": {
        "alignAsTable": true,
        "avg": false,
        "current": true,
        "max": false,
        "min": false,
        "rightSide": true,
        "show": true,
        "sideWidth": 200,
        "sort": "current",
        "sortDesc": true,
        "total": false,
        "values": true
      },
      "lines": true,
      "linewidth": 1,
      "links": [],
      "nullPointMode": "null",
      "options": {
        "alertThreshold": true
      },
      "percentage": false,
      "pluginVersion": "7.3.7",
      "pointradius": 5,
      "points": false,
      "renderer": "flot",
      "seriesOverrides": [],
      "spaceLength": 10,
      "stack": false,
      "steppedLine": false,
      "targets": [
        {
          "database": "fastnetmon",
          "dateColDataType": "metricDate",
          "dateLoading": false,
          "dateTimeColDataType": "metricDateTime",
          "dateTimeType": "DATETIME",
          "datetimeLoading": false,
          "dsType": "influxdb",
          "extrapolate": true,
          "format": "time_series",
          "formattedQuery": "<font color=\"darkcyan\">$columns</font>(<br />    host c,<br />    <font color=\"navajowhite\">sum</font>(packets_incoming) <font color=\"navajowhite\">length</font>)<br /><font color=\"darkorange\">FROM</font> <font color=\"darkcyan\">$table</font><br /><font color=\"darkorange\">WHERE</font> host <font color=\"darkorange\">in</font> (<br />    <font color=\"darkorange\">SELECT</font> host<br />    <font color=\"darkorange\">FROM</font><br />(<br />        <font color=\"darkorange\">SELECT</font><br />            host,<br />            <font color=\"navajowhite\">sum</font>(packets_incoming) <font color=\"darkorange\">as</font> <font color=\"navajowhite\">length</font><br />        <font color=\"darkorange\">FROM</font> <font color=\"darkcyan\">$table</font><br />        <font color=\"darkorange\">GROUP BY</font> host<br />        <font color=\"darkorange\">ORDER BY</font> <font color=\"navajowhite\">length</font> <font color=\"darkorange\">DESC</font><br />        <font color=\"darkorange\">LIMIT</font> <font color=\"cornflowerblue\">10</font><br />))",
          "groupBy": [
            {
              "params": [
                "$__interval"
              ],
              "type": "time"
            },
            {
              "params": [
                "null"
              ],
              "type": "fill"
            }
          ],
          "interval": "1s",
          "intervalFactor": 1,
          "orderByTime": "ASC",
          "policy": "default",
          "query": "$columns(\n    asn_number c,\n    sum(packets_incoming) length)\nFROM $table\nWHERE asn_number in (\n    SELECT asn_number\n    FROM\n(\n        SELECT\n            asn_number,\n            sum(packets_incoming) as length\n        FROM $table\n        WHERE $timeFilter \n        GROUP BY asn_number\n        ORDER BY length DESC\n        LIMIT 10\n))",
          "rawQuery": "SELECT t, groupArray((c, length)) AS groupArr FROM ( SELECT (intDiv(toUInt32(metricDateTime), 1) * 1) * 1000 AS t, asn_number c, sum(packets_incoming) length FROM fastnetmon.asn_metrics_ipv4 WHERE metricDate >= toDate(1611437089) AND metricDateTime >= toDateTime(1611437089) AND asn_number in (     SELECT asn_number     FROM (         SELECT             asn_number,             sum(packets_incoming) as length         FROM fastnetmon.asn_metrics_ipv4         WHERE metricDate >= toDate(1611437089) AND metricDateTime >= toDateTime(1611437089)          GROUP BY asn_number         ORDER BY length DESC         LIMIT 10 )) GROUP BY t, c ORDER BY t, c) GROUP BY t ORDER BY t",
          "refId": "A",
          "resultFormat": "time_series",
          "round": "0s",
          "select": [
            [
              {
                "params": [
                  "value"
                ],
                "type": "field"
              },
              {
                "params": [],
                "type": "mean"
              }
            ]
          ],
          "table": "asn_metrics_ipv4",
          "tableLoading": false,
          "tags": []
        }
      ],
      "thresholds": [],
      "timeFrom": null,
      "timeRegions": [],
      "timeShift": null,
      "title": "Packets incoming",
      "tooltip": {
        "shared": false,
        "sort": 0,
        "value_type": "individual"
      },
      "transparent": true,
      "type": "graph",
      "xaxis": {
        "buckets": null,
        "mode": "time",
        "name": null,
        "show": false,
        "values": []
      },
      "yaxes": [
        {
          "format": "pps",
          "label": "PPS IN",
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        },
        {
          "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_CLICKHOUSE}",
      "fieldConfig": {
        "defaults": {
          "custom": {}
        },
        "overrides": []
      },
      "fill": 1,
      "fillGradient": 0,
      "gridPos": {
        "h": 6,
        "w": 24,
        "x": 0,
        "y": 18
      },
      "hiddenSeries": false,
      "id": 4,
      "legend": {
        "alignAsTable": true,
        "avg": false,
        "current": true,
        "max": false,
        "min": false,
        "rightSide": true,
        "show": true,
        "sideWidth": 185,
        "sort": "current",
        "sortDesc": true,
        "total": false,
        "values": true
      },
      "lines": true,
      "linewidth": 1,
      "links": [],
      "nullPointMode": "null",
      "options": {
        "alertThreshold": true
      },
      "percentage": false,
      "pluginVersion": "7.3.7",
      "pointradius": 5,
      "points": false,
      "renderer": "flot",
      "seriesOverrides": [
        {
          "alias": "/./",
          "transform": "negative-Y"
        }
      ],
      "spaceLength": 10,
      "stack": false,
      "steppedLine": false,
      "targets": [
        {
          "database": "fastnetmon",
          "dateColDataType": "metricDate",
          "dateLoading": false,
          "dateTimeColDataType": "metricDateTime",
          "dateTimeType": "DATETIME",
          "datetimeLoading": false,
          "dsType": "influxdb",
          "extrapolate": true,
          "format": "time_series",
          "formattedQuery": "<font color=\"darkcyan\">$columns</font>(<br />    host c,<br />    <font color=\"navajowhite\">sum</font>(packets_incoming) <font color=\"navajowhite\">length</font>)<br /><font color=\"darkorange\">FROM</font> <font color=\"darkcyan\">$table</font><br /><font color=\"darkorange\">WHERE</font> host <font color=\"darkorange\">in</font> (<br />    <font color=\"darkorange\">SELECT</font> host<br />    <font color=\"darkorange\">FROM</font><br />(<br />        <font color=\"darkorange\">SELECT</font><br />            host,<br />            <font color=\"navajowhite\">sum</font>(packets_incoming) <font color=\"darkorange\">as</font> <font color=\"navajowhite\">length</font><br />        <font color=\"darkorange\">FROM</font> <font color=\"darkcyan\">$table</font><br />        <font color=\"darkorange\">GROUP BY</font> host<br />        <font color=\"darkorange\">ORDER BY</font> <font color=\"navajowhite\">length</font> <font color=\"darkorange\">DESC</font><br />        <font color=\"darkorange\">LIMIT</font> <font color=\"cornflowerblue\">10</font><br />))",
          "groupBy": [
            {
              "params": [
                "$__interval"
              ],
              "type": "time"
            },
            {
              "params": [
                "null"
              ],
              "type": "fill"
            }
          ],
          "interval": "1s",
          "intervalFactor": 1,
          "orderByTime": "ASC",
          "policy": "default",
          "query": "$columns(\n    asn_number c,\n    sum(packets_outgoing) length)\nFROM $table\nWHERE asn_number in (\n    SELECT asn_number\n    FROM\n(\n        SELECT\n            asn_number,\n            sum(packets_outgoing) as length\n        FROM $table\n        WHERE $timeFilter \n        GROUP BY asn_number\n        ORDER BY length DESC\n        LIMIT 10))",
          "rawQuery": "SELECT t, groupArray((c, length)) AS groupArr FROM ( SELECT (intDiv(toUInt32(metricDateTime), 1) * 1) * 1000 AS t, asn_number c, sum(packets_outgoing) length FROM fastnetmon.asn_metrics_ipv4 WHERE metricDate >= toDate(1611437096) AND metricDateTime >= toDateTime(1611437096) AND asn_number in (     SELECT asn_number     FROM (         SELECT             asn_number,             sum(packets_outgoing) as length         FROM fastnetmon.asn_metrics_ipv4         WHERE metricDate >= toDate(1611437096) AND metricDateTime >= toDateTime(1611437096)          GROUP BY asn_number         ORDER BY length DESC         LIMIT 10)) GROUP BY t, c ORDER BY t, c) GROUP BY t ORDER BY t",
          "refId": "A",
          "resultFormat": "time_series",
          "round": "0s",
          "select": [
            [
              {
                "params": [
                  "value"
                ],
                "type": "field"
              },
              {
                "params": [],
                "type": "mean"
              }
            ]
          ],
          "table": "asn_metrics_ipv4",
          "tableLoading": false,
          "tags": []
        }
      ],
      "thresholds": [],
      "timeFrom": null,
      "timeRegions": [],
      "timeShift": null,
      "title": "Packets outgoing",
      "tooltip": {
        "shared": false,
        "sort": 0,
        "value_type": "individual"
      },
      "transparent": true,
      "type": "graph",
      "xaxis": {
        "buckets": null,
        "mode": "time",
        "name": null,
        "show": true,
        "values": []
      },
      "yaxes": [
        {
          "format": "pps",
          "label": "PPS OUT",
          "logBase": 1,
          "max": null,
          "min": null,
          "show": true
        },
        {
          "format": "short",
          "label": null,
          "logBase": 1,
          "max": null,
          "min": null,
          "show": false
        }
      ],
      "yaxis": {
        "align": false,
        "alignLevel": null
      }
    }
  ],
  "refresh": "30s",
  "schemaVersion": 26,
  "style": "dark",
  "tags": [],
  "templating": {
    "list": []
  },
  "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": "FastNetMon Advanced TOP 10 ASNs",
  "uid": "3VNbfPxmzz",
  "version": 7
}