Skip to main content

Inventory Dashboard

Screenshot_20240502_111258.png



{
  "annotations": {
    "list": [
      {
        "builtIn": 1,
        "datasource": {
          "type": "datasource",
          "uid": "grafana"
        },
        "enable": true,
        "hide": true,
        "iconColor": "rgba(0, 211, 255, 1)",
        "name": "Annotations & Alerts",
        "target": {
          "limit": 100,
          "matchAny": false,
          "tags": [],
          "type": "dashboard"
        },
        "type": "dashboard"
      }
    ]
  },
  "editable": true,
  "fiscalYearStartMonth": 0,
  "graphTooltip": 0,
  "id": 2709,
  "links": [],
  "liveNow": false,
  "panels": [
    {
      "datasource": {
        "type": "prometheus",
        "uid": "VM2"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "fixed"
          },
          "custom": {
            "align": "center",
            "cellOptions": {
              "type": "auto"
            },
            "filterable": false,
            "inspect": false
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          },
          "unitScale": true
        },
        "overrides": [
          {
            "matcher": {
              "id": "byName",
              "options": "Value #C"
            },
            "properties": [
              {
                "id": "unit",
                "value": "decbytes"
              },
              {
                "id": "displayName",
                "value": "Memory (GB)"
              },
              {
                "id": "custom.width",
                "value": 100
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "Value #D"
            },
            "properties": [
              {
                "id": "unit",
                "value": "percent"
              },
              {
                "id": "displayName",
                "value": "/ (%)"
              },
              {
                "id": "custom.width"
              },
              {
                "id": "custom.cellOptions",
                "value": {
                  "mode": "lcd",
                  "type": "gauge"
                }
              },
              {
                "id": "color"
              },
              {
                "id": "max",
                "value": 100
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "Value #A"
            },
            "properties": [
              {
                "id": "displayName",
                "value": "Status"
              },
              {
                "id": "custom.cellOptions",
                "value": {
                  "mode": "basic",
                  "type": "color-background"
                }
              },
              {
                "id": "mappings",
                "value": [
                  {
                    "options": {
                      "0": {
                        "color": "red",
                        "index": 1,
                        "text": "DOWN"
                      },
                      "1": {
                        "color": "green",
                        "index": 0,
                        "text": "Running"
                      }
                    },
                    "type": "value"
                  }
                ]
              },
              {
                "id": "custom.width",
                "value": 100
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "Value #B"
            },
            "properties": [
              {
                "id": "displayName",
                "value": "CPU"
              },
              {
                "id": "custom.width",
                "value": 60
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "Value #F"
            },
            "properties": [
              {
                "id": "unit",
                "value": "decbytes"
              },
              {
                "id": "displayName",
                "value": "/ (GB)"
              },
              {
                "id": "custom.width",
                "value": 100
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "instance"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 300
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 31,
        "w": 24,
        "x": 0,
        "y": 0
      },
      "id": 2,
      "options": {
        "cellHeight": "sm",
        "footer": {
          "countRows": false,
          "fields": "",
          "reducer": [
            "sum"
          ],
          "show": false
        },
        "frameIndex": 1,
        "showHeader": true
      },
      "pluginVersion": "10.3.1",
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "VM2"
          },
          "editorMode": "code",
          "exemplar": true,
          "expr": "up{env=~\"$env\", job=~\"instance|hoster|.*node.*\"}",
          "format": "table",
          "hide": false,
          "instant": false,
          "interval": "",
          "legendFormat": "Status",
          "refId": "A"
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "VM2"
          },
          "editorMode": "code",
          "exemplar": true,
          "expr": "count without (cpu, mode) (node_cpu_seconds_total{mode=\"idle\", env=~\"$env\", job=~\"instance|hoster|.*node.*\"})",
          "format": "table",
          "hide": false,
          "instant": false,
          "interval": "",
          "legendFormat": "CPU",
          "refId": "B"
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "VM2"
          },
          "editorMode": "code",
          "exemplar": true,
          "expr": "node_memory_MemTotal_bytes{env=~\"$env\", job=~\"instance|hoster|.*node.*\"}",
          "format": "table",
          "hide": false,
          "interval": "",
          "legendFormat": "Memory",
          "range": true,
          "refId": "C"
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "VM2"
          },
          "editorMode": "code",
          "exemplar": true,
          "expr": "node_filesystem_size_bytes{mountpoint=\"/\",fstype!=\"rootfs\", env=~\"$env\", job=~\"instance|hoster|.*node.*\"}",
          "format": "table",
          "hide": false,
          "interval": "",
          "legendFormat": "Disk Root",
          "range": true,
          "refId": "F"
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "VM2"
          },
          "editorMode": "code",
          "exemplar": true,
          "expr": "100 - ((node_filesystem_avail_bytes{mountpoint=\"/\",fstype!=\"rootfs\", env=~\"$env\", job=~\"instance|hoster|.*node.*\"} * 100) / node_filesystem_size_bytes{mountpoint=\"/\",fstype!=\"rootfs\", env=~\"$env\", job=~\"instance|hoster|.*node.*\"})",
          "format": "table",
          "hide": false,
          "interval": "",
          "legendFormat": "Disk Root %",
          "range": true,
          "refId": "D"
        }
      ],
      "title": "Inventory List",
      "transformations": [
        {
          "id": "seriesToColumns",
          "options": {
            "byField": "instance"
          }
        },
        {
          "id": "organize",
          "options": {
            "excludeByName": {
              "Time": true,
              "Time 1": true,
              "Time 2": true,
              "Time 3": true,
              "Time 4": true,
              "Time 5": true,
              "Time 6": true,
              "Time 7": true,
              "Value #D": false,
              "Value #F": false,
              "__name__ 1": true,
              "__name__ 2": true,
              "__name__ 3": true,
              "__name__ 4": true,
              "__name__ 5": true,
              "cluster": true,
              "cluster 1": true,
              "cluster 2": true,
              "cluster 3": true,
              "cluster 4": true,
              "cluster 5": true,
              "container 1": true,
              "container 2": true,
              "container 3": true,
              "container 4": true,
              "container 5": true,
              "dc 1": true,
              "dc 2": true,
              "dc 3": true,
              "dc 4": true,
              "dc 5": true,
              "device": true,
              "device 2": true,
              "device 3": true,
              "device 4": true,
              "endpoint 1": true,
              "endpoint 2": true,
              "endpoint 3": true,
              "endpoint 4": true,
              "endpoint 5": true,
              "env": true,
              "env 1": true,
              "env 2": true,
              "env 3": true,
              "env 4": true,
              "env 5": true,
              "env 6": true,
              "env 7": true,
              "fstype": true,
              "fstype 2": true,
              "fstype 3": true,
              "fstype 4": true,
              "handler": true,
              "handler 1": true,
              "handler 2": true,
              "handler 3": true,
              "handler 4": true,
              "handler 5": true,
              "ip": true,
              "ip 2": true,
              "ip 3": true,
              "ip 4": true,
              "ip 5": true,
              "ip 6": true,
              "ip 7": true,
              "job": true,
              "job 1": true,
              "job 2": true,
              "job 3": true,
              "job 4": true,
              "job 5": true,
              "job 6": true,
              "job 7": true,
              "monitor": true,
              "monitor 2": true,
              "monitor 3": true,
              "monitor 4": true,
              "monitor 5": true,
              "monitor 6": true,
              "monitor 7": true,
              "mountpoint": true,
              "mountpoint 2": true,
              "mountpoint 3": true,
              "mountpoint 4": true,
              "namespace 1": true,
              "namespace 2": true,
              "namespace 3": true,
              "namespace 4": true,
              "namespace 5": true,
              "pod 1": true,
              "pod 2": true,
              "pod 3": true,
              "pod 4": true,
              "pod 5": true,
              "project": true,
              "project 2": true,
              "project 3": true,
              "project 4": true,
              "project 5": true,
              "project 6": true,
              "project 7": true,
              "prometheus 1": true,
              "prometheus 2": true,
              "prometheus 3": true,
              "prometheus 4": true,
              "prometheus 5": true,
              "prometheus_replica 1": true,
              "prometheus_replica 2": true,
              "prometheus_replica 3": true,
              "prometheus_replica 4": true,
              "prometheus_replica 5": true,
              "service 1": true,
              "service 2": true,
              "service 3": true,
              "service 4": true,
              "service 5": true,
              "swarm_container_address": true,
              "swarm_container_address 2": true,
              "swarm_container_address 3": true,
              "swarm_container_address 4": true,
              "swarm_container_address 5": true,
              "swarm_container_address 6": true,
              "swarm_container_address 7": true
            },
            "includeByName": {},
            "indexByName": {
              "Time 1": 29,
              "Time 2": 6,
              "Time 3": 12,
              "Time 4": 21,
              "Time 5": 35,
              "Value #A": 1,
              "Value #B": 2,
              "Value #C": 3,
              "Value #D": 5,
              "Value #F": 4,
              "__name__ 1": 7,
              "__name__ 2": 13,
              "__name__ 3": 34,
              "cluster 1": 30,
              "cluster 2": 8,
              "cluster 3": 14,
              "cluster 4": 22,
              "cluster 5": 36,
              "device": 15,
              "device 2": 23,
              "env 1": 31,
              "env 2": 9,
              "env 3": 16,
              "env 4": 24,
              "env 5": 37,
              "fstype": 17,
              "fstype 2": 25,
              "handler 1": 33,
              "handler 2": 10,
              "handler 3": 20,
              "handler 4": 28,
              "handler 5": 39,
              "instance": 0,
              "job 1": 32,
              "job 2": 11,
              "job 3": 18,
              "job 4": 26,
              "job 5": 38,
              "mountpoint": 19,
              "mountpoint 2": 27
            },
            "renameByName": {}
          }
        }
      ],
      "type": "table"
    }
  ],
  "refresh": "",
  "schemaVersion": 39,
  "tags": [],
  "templating": {
    "list": [
      {
        "current": {
          "selected": false,
          "text": "All",
          "value": "$__all"
        },
        "datasource": {
          "type": "prometheus",
          "uid": "VM2"
        },
        "definition": "label_values(up{job=~\"instance|hoster\"},env)",
        "hide": 0,
        "includeAll": true,
        "multi": true,
        "name": "env",
        "options": [],
        "query": {
          "qryType": 1,
          "query": "label_values(up{job=~\"instance|hoster\"},env)",
          "refId": "PrometheusVariableQueryEditor-VariableQuery"
        },
        "refresh": 1,
        "regex": "",
        "skipUrlSync": false,
        "sort": 0,
        "type": "query"
      }
    ]
  },
  "time": {
    "from": "now-1h",
    "to": "now"
  },
  "timepicker": {},
  "timezone": "",
  "title": "Inventory Dashboard",
  "uid": "inventory-dashboard",
  "version": 4,
  "weekStart": ""
}