Commit ee940f1b authored by Luis de la Cal's avatar Luis de la Cal
Browse files

- Moved cybersecurity KPIs to its own panel in the Grafana dashboard.

- Adjusted the rule used to display the name of the cybersecurity KPIs in the Grafana dashboard.
parent 764d91c9
Loading
Loading
Loading
Loading
+184 −4
Original line number Diff line number Diff line
{"overwrite": true, "folderId": 0, "dashboard":
{
  "overwrite": true,
  "folderId": 0,
  "dashboard": {
    "id": null,
    "annotations": {
      "list": [
@@ -169,7 +171,7 @@
            "hide": false,
            "metricColumn": "kpi_value",
            "rawQuery": true,
            "rawSql": "SELECT\r\n  $__time(timestamp), kpi_value AS metric, device_id, endpoint_id, kpi_sample_type\r\nFROM\r\n  monitoring\r\nWHERE\r\n  $__timeFilter(timestamp) AND device_id IN ($device_id) AND endpoint_id IN ($endpoint_id) AND kpi_sample_type IN ($kpi_sample_type)\r\nGROUP BY\r\n  device_id, endpoint_id, kpi_sample_type\r\nORDER BY\r\n  timestamp\r\n",
            "rawSql": "SELECT\r\n  $__time(timestamp), kpi_value AS metric, device_id, endpoint_id, kpi_sample_type\r\nFROM\r\n  monitoring\r\nWHERE\r\n  $__timeFilter(timestamp) AND device_id IN ($device_id) AND endpoint_id IN ($endpoint_id) AND kpi_sample_type IN ($kpi_sample_type) AND NOT (kpi_sample_type like '%L3%' OR kpi_sample_type like '%ML_CONFIDENCE%') \r\nGROUP BY\r\n  device_id, endpoint_id, kpi_sample_type\r\nORDER BY\r\n  timestamp\r\n",
            "refId": "A",
            "select": [
              [
@@ -207,6 +209,184 @@
          }
        ],
        "type": "timeseries"
      },
      {
        "datasource": {
          "type": "postgres",
          "uid": "monitoringdb"
        },
        "fieldConfig": {
          "defaults": {
            "color": {
              "mode": "palette-classic"
            },
            "custom": {
              "axisLabel": "",
              "axisPlacement": "auto",
              "barAlignment": 0,
              "drawStyle": "line",
              "fillOpacity": 0,
              "gradientMode": "none",
              "hideFrom": {
                "legend": false,
                "tooltip": false,
                "viz": false
              },
              "lineInterpolation": "smooth",
              "lineWidth": 1,
              "pointSize": 5,
              "scaleDistribution": {
                "type": "linear"
              },
              "showPoints": "always",
              "spanNulls": true,
              "stacking": {
                "group": "A",
                "mode": "none"
              },
              "thresholdsStyle": {
                "mode": "off"
              }
            },
            "mappings": [],
            "thresholds": {
              "mode": "absolute",
              "steps": [
                {
                  "color": "green",
                  "value": null
                },
                {
                  "color": "red",
                  "value": 80
                }
              ]
            }
          },
          "overrides": [
            {
              "matcher": {
                "id": "byRegexp",
                "options": ".*PACKETS_.*"
              },
              "properties": [
                {
                  "id": "custom.axisPlacement",
                  "value": "left"
                },
                {
                  "id": "unit",
                  "value": "pps"
                },
                {
                  "id": "custom.axisLabel",
                  "value": "Packets / sec"
                },
                {
                  "id": "custom.axisSoftMin",
                  "value": 0
                }
              ]
            },
            {
              "matcher": {
                "id": "byRegexp",
                "options": ".*BYTES_.*"
              },
              "properties": [
                {
                  "id": "custom.axisPlacement",
                  "value": "right"
                },
                {
                  "id": "unit",
                  "value": "Bps"
                },
                {
                  "id": "custom.axisLabel",
                  "value": "Bytes / sec"
                },
                {
                  "id": "custom.axisSoftMin",
                  "value": 0
                }
              ]
            }
          ]
        },
        "gridPos": {
          "h": 19,
          "w": 24,
          "x": 0,
          "y": 50
        },
        "id": 3,
        "options": {
          "legend": {
            "calcs": [
              "first",
              "min",
              "mean",
              "max",
              "lastNotNull"
            ],
            "displayMode": "table",
            "placement": "right"
          },
          "tooltip": {
            "mode": "multi",
            "sort": "none"
          }
        },
        "targets": [
          {
            "datasource": {
              "type": "postgres",
              "uid": "monitoringdb"
            },
            "format": "time_series",
            "group": [],
            "hide": false,
            "metricColumn": "kpi_value",
            "rawQuery": true,
            "rawSql": "SELECT\r\n  $__time(timestamp), kpi_value AS metric, device_id, endpoint_id, kpi_sample_type\r\nFROM\r\n  monitoring\r\nWHERE\r\n  $__timeFilter(timestamp) AND device_id IN ($device_id) AND endpoint_id IN ($endpoint_id) AND kpi_sample_type IN ($kpi_sample_type) AND (kpi_sample_type like '%L3%' OR kpi_sample_type like '%ML_CONFIDENCE%') \r\nGROUP BY\r\n  device_id, endpoint_id, kpi_sample_type\r\nORDER BY\r\n  timestamp\r\n",
            "refId": "A",
            "select": [
              [
                {
                  "params": [
                    "kpi_value"
                  ],
                  "type": "column"
                }
              ]
            ],
            "table": "monitoring",
            "timeColumn": "timestamp",
            "where": [
              {
                "name": "",
                "params": [
                  "device_id",
                  "IN",
                  "$device_id"
                ],
                "type": "expression"
              }
            ]
          }
        ],
        "title": "L3 Cybersecurity KPIs",
        "transformations": [
          {
            "id": "renameByRegex",
            "options": {
              "regex": "metric {device_id=\"(.?)\", endpoint_id=\"(.?)\", kpi_sample_type=\"(.*)\"}",
              "renamePattern": "$3"
            }
          }
        ],
        "type": "timeseries"
      }
    ],
    "refresh": "5s",