{
  "annotations": {
    "list": [
      {
        "builtIn": 1,
        "datasource": {
          "type": "datasource",
          "uid": "grafana"
        },
        "enable": true,
        "hide": true,
        "iconColor": "rgba(0, 211, 255, 1)",
        "name": "Annotations & Alerts",
        "type": "dashboard"
      }
    ]
  },
  "description": "Docker Swarm stacks and services metrics",
  "editable": true,
  "fiscalYearStartMonth": 0,
  "gnetId": 11939,
  "graphTooltip": 0,
  "id": 9,
  "links": [],
  "liveNow": false,
  "panels": [
    {
      "datasource": {
        "type": "prometheus",
        "uid": "b49a38fd-f343-4ece-942f-03be5cd6a7bf"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "fixedColor": "rgb(31, 120, 193)",
            "mode": "fixed"
          },
          "decimals": 0,
          "mappings": [
            {
              "options": {
                "match": "null",
                "result": {
                  "text": "N/A"
                }
              },
              "type": "special"
            }
          ],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          },
          "unit": "none"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 4,
        "w": 3,
        "x": 0,
        "y": 0
      },
      "id": 44,
      "links": [],
      "maxDataPoints": 100,
      "options": {
        "colorMode": "none",
        "graphMode": "area",
        "justifyMode": "auto",
        "orientation": "horizontal",
        "reduceOptions": {
          "calcs": ["lastNotNull"],
          "fields": "",
          "values": false
        },
        "textMode": "auto"
      },
      "pluginVersion": "10.0.1",
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "b49a38fd-f343-4ece-942f-03be5cd6a7bf"
          },
          "editorMode": "code",
          "expr": "count(swarm_node_info{node_name=~\"$node_name\"})",
          "format": "time_series",
          "intervalFactor": 2,
          "range": true,
          "refId": "A",
          "step": 1800
        }
      ],
      "title": "Nodes",
      "type": "stat"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "b49a38fd-f343-4ece-942f-03be5cd6a7bf"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "fixedColor": "rgb(31, 120, 193)",
            "mode": "fixed"
          },
          "decimals": 0,
          "mappings": [
            {
              "options": {
                "match": "null",
                "result": {
                  "text": "N/A"
                }
              },
              "type": "special"
            }
          ],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          },
          "unit": "none"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 4,
        "w": 3,
        "x": 3,
        "y": 0
      },
      "id": 45,
      "links": [],
      "maxDataPoints": 100,
      "options": {
        "colorMode": "none",
        "graphMode": "area",
        "justifyMode": "auto",
        "orientation": "horizontal",
        "reduceOptions": {
          "calcs": ["lastNotNull"],
          "fields": "",
          "values": false
        },
        "textMode": "auto"
      },
      "pluginVersion": "10.0.1",
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "b49a38fd-f343-4ece-942f-03be5cd6a7bf"
          },
          "editorMode": "code",
          "expr": "count(sum(container_tasks_state{node_name=~\"$node_name\", container_label_com_docker_stack_namespace=~\"$stack_name\"}) by (container_label_com_docker_stack_namespace))",
          "format": "time_series",
          "instant": false,
          "intervalFactor": 2,
          "refId": "A",
          "step": 1800
        }
      ],
      "title": "Stacks",
      "type": "stat"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "b49a38fd-f343-4ece-942f-03be5cd6a7bf"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "fixedColor": "rgb(31, 120, 193)",
            "mode": "fixed"
          },
          "decimals": 0,
          "mappings": [
            {
              "options": {
                "match": "null",
                "result": {
                  "text": "N/A"
                }
              },
              "type": "special"
            }
          ],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          },
          "unit": "none"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 4,
        "w": 3,
        "x": 6,
        "y": 0
      },
      "id": 47,
      "links": [],
      "maxDataPoints": 100,
      "options": {
        "colorMode": "none",
        "graphMode": "area",
        "justifyMode": "auto",
        "orientation": "horizontal",
        "reduceOptions": {
          "calcs": ["lastNotNull"],
          "fields": "",
          "values": false
        },
        "textMode": "auto"
      },
      "pluginVersion": "10.0.1",
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "b49a38fd-f343-4ece-942f-03be5cd6a7bf"
          },
          "editorMode": "code",
          "expr": "count(sum(container_tasks_state{container_label_com_docker_swarm_service_name=~\".+\", node_name=~\"$node_name\", container_label_com_docker_stack_namespace=~\"$stack_name\"}) by (container_label_com_docker_swarm_service_name))",
          "format": "time_series",
          "intervalFactor": 2,
          "range": true,
          "refId": "A",
          "step": 1800
        }
      ],
      "title": "Services",
      "type": "stat"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "b49a38fd-f343-4ece-942f-03be5cd6a7bf"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "fixedColor": "rgb(31, 120, 193)",
            "mode": "fixed"
          },
          "decimals": 0,
          "mappings": [
            {
              "options": {
                "match": "null",
                "result": {
                  "text": "N/A"
                }
              },
              "type": "special"
            }
          ],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          },
          "unit": "none"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 4,
        "w": 3,
        "x": 9,
        "y": 0
      },
      "id": 46,
      "links": [],
      "maxDataPoints": 100,
      "options": {
        "colorMode": "none",
        "graphMode": "area",
        "justifyMode": "auto",
        "orientation": "horizontal",
        "reduceOptions": {
          "calcs": ["lastNotNull"],
          "fields": "",
          "values": false
        },
        "text": {},
        "textMode": "value"
      },
      "pluginVersion": "10.0.1",
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "b49a38fd-f343-4ece-942f-03be5cd6a7bf"
          },
          "editorMode": "code",
          "exemplar": false,
          "expr": "count(sum(container_tasks_state{container_label_com_docker_stack_namespace=~\"$stack_name\", node_name=~\"$node_name\"}) by (container_label_com_docker_swarm_task_name))",
          "format": "time_series",
          "instant": false,
          "intervalFactor": 2,
          "range": true,
          "refId": "A",
          "step": 1800
        }
      ],
      "title": "Containers",
      "type": "stat"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "b49a38fd-f343-4ece-942f-03be5cd6a7bf"
      },
      "description": "",
      "fieldConfig": {
        "defaults": {
          "color": {
            "fixedColor": "#C4162A",
            "mode": "continuous-YlRd",
            "seriesBy": "last"
          },
          "custom": {
            "axisCenteredZero": false,
            "axisColorMode": "text",
            "axisLabel": "",
            "axisPlacement": "auto",
            "barAlignment": 0,
            "drawStyle": "bars",
            "fillOpacity": 100,
            "gradientMode": "none",
            "hideFrom": {
              "legend": false,
              "tooltip": false,
              "viz": false
            },
            "lineInterpolation": "stepAfter",
            "lineWidth": 1,
            "pointSize": 1,
            "scaleDistribution": {
              "type": "linear"
            },
            "showPoints": "never",
            "spanNulls": false,
            "stacking": {
              "group": "A",
              "mode": "none"
            },
            "thresholdsStyle": {
              "mode": "off"
            }
          },
          "decimals": 0,
          "mappings": [],
          "min": 0,
          "noValue": "No alerts",
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              }
            ]
          },
          "unit": "none"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 4,
        "w": 12,
        "x": 12,
        "y": 0
      },
      "id": 57,
      "links": [],
      "options": {
        "legend": {
          "calcs": ["mean", "lastNotNull", "max", "min"],
          "displayMode": "table",
          "placement": "bottom",
          "showLegend": false
        },
        "tooltip": {
          "mode": "multi",
          "sort": "none"
        }
      },
      "pluginVersion": "10.0.1",
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "b49a38fd-f343-4ece-942f-03be5cd6a7bf"
          },
          "editorMode": "code",
          "expr": "sum(rate(ALERTS{node_name=~\"$node_name\", node_name=~\"orchestra-swarm-.*\", alertstate=\"firing\"}[1m])) by(node_name)",
          "format": "time_series",
          "instant": false,
          "intervalFactor": 1,
          "legendFormat": "{{ Disk Usage in GB }}",
          "refId": "A"
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "b49a38fd-f343-4ece-942f-03be5cd6a7bf"
          },
          "editorMode": "code",
          "expr": "sum(rate(ALERTS{node_name=~\"$node_name\", node_name=~\"orchestra-swarm-.*\", alertstate=\"pending\"}[1m])) by(node_name)",
          "hide": false,
          "instant": false,
          "range": true,
          "refId": "B"
        }
      ],
      "title": "Alerts",
      "type": "timeseries"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "b49a38fd-f343-4ece-942f-03be5cd6a7bf"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "mappings": [
            {
              "options": {
                "match": "null",
                "result": {
                  "text": "N/A"
                }
              },
              "type": "special"
            }
          ],
          "max": 100,
          "min": 0,
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "rgba(245, 54, 54, 0.9)",
                "value": null
              },
              {
                "color": "rgba(237, 129, 40, 0.89)",
                "value": 10
              },
              {
                "color": "rgba(50, 172, 45, 0.97)",
                "value": 25
              }
            ]
          },
          "unit": "percent"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 7,
        "w": 4,
        "x": 0,
        "y": 4
      },
      "hideTimeOverride": true,
      "id": 11,
      "links": [],
      "maxDataPoints": 100,
      "options": {
        "orientation": "horizontal",
        "reduceOptions": {
          "calcs": ["mean"],
          "fields": "",
          "values": false
        },
        "showThresholdLabels": false,
        "showThresholdMarkers": true
      },
      "pluginVersion": "10.0.1",
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "b49a38fd-f343-4ece-942f-03be5cd6a7bf"
          },
          "editorMode": "code",
          "expr": "sum(irate(node_cpu_seconds_total{mode=\"idle\"}[1m]) * on(instance) group_left(node_name) swarm_node_info{node_name=~\"$node_name\"}) * 100 / count(node_cpu_seconds_total{mode=\"user\"} * on(instance) group_left(node_name) swarm_node_info{node_name=~\"$node_name\"}) ",
          "format": "time_series",
          "intervalFactor": 2,
          "legendFormat": "",
          "range": true,
          "refId": "A",
          "step": 2
        }
      ],
      "timeFrom": "1m",
      "title": "CPU Idle",
      "type": "gauge"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "b49a38fd-f343-4ece-942f-03be5cd6a7bf"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "mappings": [
            {
              "options": {
                "match": "null",
                "result": {
                  "text": "N/A"
                }
              },
              "type": "special"
            }
          ],
          "max": 100,
          "min": 0,
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "rgba(245, 54, 54, 0.9)",
                "value": null
              },
              {
                "color": "rgba(237, 129, 40, 0.89)",
                "value": 10
              },
              {
                "color": "rgba(50, 172, 45, 0.97)",
                "value": 25
              }
            ]
          },
          "unit": "percent"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 7,
        "w": 4,
        "x": 4,
        "y": 4
      },
      "id": 53,
      "links": [],
      "maxDataPoints": 100,
      "options": {
        "orientation": "horizontal",
        "reduceOptions": {
          "calcs": ["mean"],
          "fields": "",
          "values": false
        },
        "showThresholdLabels": false,
        "showThresholdMarkers": true
      },
      "pluginVersion": "10.0.1",
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "b49a38fd-f343-4ece-942f-03be5cd6a7bf"
          },
          "editorMode": "code",
          "expr": "sum((node_memory_MemAvailable_bytes / node_memory_MemTotal_bytes) * on(instance) group_left(node_name) swarm_node_info{node_name=~\"$node_name\"} * 100) / count(swarm_node_info * on(instance) group_left(node_name) swarm_node_info{node_name=~\"$node_name\"})",
          "format": "time_series",
          "intervalFactor": 2,
          "legendFormat": "",
          "range": true,
          "refId": "A",
          "step": 20
        }
      ],
      "title": "Available Memory",
      "type": "gauge"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "b49a38fd-f343-4ece-942f-03be5cd6a7bf"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "mappings": [
            {
              "options": {
                "match": "null",
                "result": {
                  "text": "N/A"
                }
              },
              "type": "special"
            }
          ],
          "max": 100,
          "min": 0,
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "rgba(245, 54, 54, 0.9)",
                "value": null
              },
              {
                "color": "rgba(237, 129, 40, 0.89)",
                "value": 10
              },
              {
                "color": "rgba(50, 172, 45, 0.97)",
                "value": 25
              }
            ]
          },
          "unit": "percent"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 7,
        "w": 4,
        "x": 8,
        "y": 4
      },
      "id": 54,
      "links": [],
      "maxDataPoints": 100,
      "options": {
        "orientation": "horizontal",
        "reduceOptions": {
          "calcs": ["mean"],
          "fields": "",
          "values": false
        },
        "showThresholdLabels": false,
        "showThresholdMarkers": true
      },
      "pluginVersion": "10.0.1",
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "b49a38fd-f343-4ece-942f-03be5cd6a7bf"
          },
          "editorMode": "code",
          "expr": "sum((node_filesystem_free_bytes{ mountpoint=\"/\"} / node_filesystem_size_bytes{mountpoint=\"/\"}) * on(instance) group_left(node_name) swarm_node_info{node_name=~\"$node_name\"} * 100) / count(swarm_node_info * on(instance) group_left(node_name) swarm_node_info{node_name=~\"$node_name\"})",
          "format": "time_series",
          "intervalFactor": 2,
          "legendFormat": "",
          "range": true,
          "refId": "A",
          "step": 20
        }
      ],
      "title": "Available Disk Space",
      "type": "gauge"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "b49a38fd-f343-4ece-942f-03be5cd6a7bf"
      },
      "description": "",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "axisCenteredZero": false,
            "axisColorMode": "text",
            "axisLabel": "",
            "axisPlacement": "auto",
            "barAlignment": 0,
            "drawStyle": "line",
            "fillOpacity": 10,
            "gradientMode": "none",
            "hideFrom": {
              "legend": false,
              "tooltip": false,
              "viz": false
            },
            "lineInterpolation": "linear",
            "lineWidth": 1,
            "pointSize": 5,
            "scaleDistribution": {
              "type": "linear"
            },
            "showPoints": "never",
            "spanNulls": false,
            "stacking": {
              "group": "A",
              "mode": "none"
            },
            "thresholdsStyle": {
              "mode": "off"
            }
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          },
          "unit": "decbytes"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 7,
        "w": 12,
        "x": 12,
        "y": 4
      },
      "id": 56,
      "links": [],
      "options": {
        "legend": {
          "calcs": ["mean", "lastNotNull", "max", "min"],
          "displayMode": "table",
          "placement": "bottom",
          "showLegend": true
        },
        "tooltip": {
          "mode": "multi",
          "sort": "none"
        }
      },
      "pluginVersion": "10.0.1",
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "b49a38fd-f343-4ece-942f-03be5cd6a7bf"
          },
          "editorMode": "code",
          "expr": "sum((node_filesystem_size_bytes{mountpoint=\"/\"} - node_filesystem_avail_bytes{mountpoint=\"/\"})* on(instance) group_left(node_name) swarm_node_info{node_name=~\"$node_name\"})",
          "format": "time_series",
          "instant": false,
          "intervalFactor": 1,
          "legendFormat": "{{ Disk Usage in GB }}",
          "refId": "A"
        }
      ],
      "title": "Nodes Disk Usage",
      "type": "timeseries"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "b49a38fd-f343-4ece-942f-03be5cd6a7bf"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "axisCenteredZero": false,
            "axisColorMode": "text",
            "axisLabel": "",
            "axisPlacement": "auto",
            "barAlignment": 0,
            "drawStyle": "line",
            "fillOpacity": 10,
            "gradientMode": "hue",
            "hideFrom": {
              "legend": false,
              "tooltip": false,
              "viz": false
            },
            "lineInterpolation": "linear",
            "lineWidth": 1,
            "pointSize": 5,
            "scaleDistribution": {
              "type": "linear"
            },
            "showPoints": "never",
            "spanNulls": false,
            "stacking": {
              "group": "A",
              "mode": "normal"
            },
            "thresholdsStyle": {
              "mode": "off"
            }
          },
          "decimals": 0,
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          },
          "unit": "short"
        },
        "overrides": [
          {
            "matcher": {
              "id": "byValue",
              "options": {
                "op": "gte",
                "reducer": "allIsZero",
                "value": 0
              }
            },
            "properties": [
              {
                "id": "custom.hideFrom",
                "value": {
                  "legend": true,
                  "tooltip": true,
                  "viz": false
                }
              }
            ]
          },
          {
            "matcher": {
              "id": "byValue",
              "options": {
                "op": "gte",
                "reducer": "allIsNull",
                "value": 0
              }
            },
            "properties": [
              {
                "id": "custom.hideFrom",
                "value": {
                  "legend": true,
                  "tooltip": true,
                  "viz": false
                }
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 7,
        "w": 12,
        "x": 0,
        "y": 11
      },
      "id": 12,
      "links": [],
      "options": {
        "legend": {
          "calcs": ["lastNotNull"],
          "displayMode": "table",
          "placement": "right",
          "showLegend": true
        },
        "tooltip": {
          "mode": "multi",
          "sort": "desc"
        }
      },
      "pluginVersion": "10.0.1",
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "b49a38fd-f343-4ece-942f-03be5cd6a7bf"
          },
          "editorMode": "code",
          "expr": "sum(rate(container_last_seen{container_label_com_docker_stack_namespace=~\"$stack_name\",node_name=~\"$node_name\"}[1m])) by (container_label_com_docker_swarm_service_name)",
          "format": "time_series",
          "intervalFactor": 10,
          "legendFormat": "{{ container_label_com_docker_swarm_service_name }}",
          "range": true,
          "refId": "A",
          "step": 10
        }
      ],
      "title": "Containers # by Service",
      "type": "timeseries"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "b49a38fd-f343-4ece-942f-03be5cd6a7bf"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "axisCenteredZero": false,
            "axisColorMode": "text",
            "axisLabel": "",
            "axisPlacement": "auto",
            "barAlignment": 0,
            "drawStyle": "line",
            "fillOpacity": 10,
            "gradientMode": "none",
            "hideFrom": {
              "legend": false,
              "tooltip": false,
              "viz": false
            },
            "lineInterpolation": "linear",
            "lineWidth": 1,
            "pointSize": 5,
            "scaleDistribution": {
              "type": "linear"
            },
            "showPoints": "never",
            "spanNulls": false,
            "stacking": {
              "group": "A",
              "mode": "normal"
            },
            "thresholdsStyle": {
              "mode": "off"
            }
          },
          "decimals": 0,
          "mappings": [],
          "min": 0,
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          },
          "unit": "none"
        },
        "overrides": [
          {
            "matcher": {
              "id": "byName",
              "options": "Ops-Infrastructure"
            },
            "properties": [
              {
                "id": "color",
                "value": {
                  "fixedColor": "#447EBC",
                  "mode": "fixed"
                }
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "{}"
            },
            "properties": [
              {
                "id": "color",
                "value": {
                  "fixedColor": "#DEDAF7",
                  "mode": "fixed"
                }
              }
            ]
          },
          {
            "matcher": {
              "id": "byType",
              "options": "time"
            },
            "properties": [
              {
                "id": "custom.axisPlacement",
                "value": "hidden"
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 7,
        "w": 12,
        "x": 12,
        "y": 11
      },
      "id": 51,
      "links": [],
      "options": {
        "legend": {
          "calcs": ["lastNotNull"],
          "displayMode": "table",
          "placement": "right",
          "showLegend": true
        },
        "tooltip": {
          "mode": "multi",
          "sort": "none"
        }
      },
      "pluginVersion": "10.0.1",
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "b49a38fd-f343-4ece-942f-03be5cd6a7bf"
          },
          "editorMode": "code",
          "expr": "sum(rate(container_last_seen{node_name=~\"$node_name\",container_label_com_docker_stack_namespace=~\"$stack_name\"}[1m])) by (container_label_com_docker_stack_namespace)",
          "format": "time_series",
          "intervalFactor": 2,
          "legendFormat": "{{container_label_com_docker_stack_namespace}}",
          "metric": "container_last_seen",
          "range": true,
          "refId": "A",
          "step": 600
        }
      ],
      "title": "Containers # by Stack",
      "type": "timeseries"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "b49a38fd-f343-4ece-942f-03be5cd6a7bf"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "axisCenteredZero": false,
            "axisColorMode": "text",
            "axisLabel": "",
            "axisPlacement": "auto",
            "barAlignment": 0,
            "drawStyle": "line",
            "fillOpacity": 10,
            "gradientMode": "none",
            "hideFrom": {
              "legend": false,
              "tooltip": false,
              "viz": false
            },
            "lineInterpolation": "linear",
            "lineWidth": 1,
            "pointSize": 5,
            "scaleDistribution": {
              "type": "linear"
            },
            "showPoints": "never",
            "spanNulls": true,
            "stacking": {
              "group": "A",
              "mode": "normal"
            },
            "thresholdsStyle": {
              "mode": "off"
            }
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          },
          "unit": "percent"
        },
        "overrides": [
          {
            "matcher": {
              "id": "byValue",
              "options": {
                "op": "gte",
                "reducer": "allIsZero",
                "value": 0
              }
            },
            "properties": [
              {
                "id": "custom.hideFrom",
                "value": {
                  "legend": true,
                  "tooltip": true,
                  "viz": false
                }
              }
            ]
          },
          {
            "matcher": {
              "id": "byValue",
              "options": {
                "op": "gte",
                "reducer": "allIsNull",
                "value": 0
              }
            },
            "properties": [
              {
                "id": "custom.hideFrom",
                "value": {
                  "legend": true,
                  "tooltip": true,
                  "viz": false
                }
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 7,
        "w": 24,
        "x": 0,
        "y": 18
      },
      "id": 22,
      "links": [],
      "options": {
        "legend": {
          "calcs": ["mean", "max", "min"],
          "displayMode": "table",
          "placement": "right",
          "showLegend": true
        },
        "tooltip": {
          "mode": "multi",
          "sort": "desc"
        }
      },
      "pluginVersion": "10.0.1",
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "b49a38fd-f343-4ece-942f-03be5cd6a7bf"
          },
          "editorMode": "code",
          "expr": "sum(irate(container_cpu_usage_seconds_total{node_name=~\"$node_name\", container_label_com_docker_stack_namespace=~\"$stack_name\"}[1m])) by (container_label_com_docker_swarm_service_name) * 100 ",
          "format": "time_series",
          "intervalFactor": 2,
          "legendFormat": "{{container_label_com_docker_swarm_service_name}}",
          "range": true,
          "refId": "A",
          "step": 2
        }
      ],
      "title": "CPU usage by Service",
      "type": "timeseries"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "b49a38fd-f343-4ece-942f-03be5cd6a7bf"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "axisCenteredZero": false,
            "axisColorMode": "text",
            "axisLabel": "",
            "axisPlacement": "auto",
            "barAlignment": 0,
            "drawStyle": "line",
            "fillOpacity": 10,
            "gradientMode": "none",
            "hideFrom": {
              "legend": false,
              "tooltip": false,
              "viz": false
            },
            "lineInterpolation": "linear",
            "lineWidth": 1,
            "pointSize": 5,
            "scaleDistribution": {
              "type": "linear"
            },
            "showPoints": "never",
            "spanNulls": true,
            "stacking": {
              "group": "A",
              "mode": "none"
            },
            "thresholdsStyle": {
              "mode": "off"
            }
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green"
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          },
          "unit": "percent"
        },
        "overrides": [
          {
            "matcher": {
              "id": "byValue",
              "options": {
                "op": "gte",
                "reducer": "allIsZero",
                "value": 0
              }
            },
            "properties": [
              {
                "id": "custom.hideFrom",
                "value": {
                  "legend": true,
                  "tooltip": true,
                  "viz": false
                }
              }
            ]
          },
          {
            "matcher": {
              "id": "byValue",
              "options": {
                "op": "gte",
                "reducer": "allIsNull",
                "value": 0
              }
            },
            "properties": [
              {
                "id": "custom.hideFrom",
                "value": {
                  "legend": true,
                  "tooltip": true,
                  "viz": false
                }
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 8,
        "w": 24,
        "x": 0,
        "y": 25
      },
      "id": 33,
      "links": [],
      "options": {
        "legend": {
          "calcs": ["mean"],
          "displayMode": "table",
          "placement": "right",
          "showLegend": true
        },
        "tooltip": {
          "mode": "multi",
          "sort": "desc"
        }
      },
      "pluginVersion": "10.0.1",
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "b49a38fd-f343-4ece-942f-03be5cd6a7bf"
          },
          "editorMode": "code",
          "expr": "topk(10, sum(irate(container_cpu_usage_seconds_total{node_name=~\"$node_name\", container_label_com_docker_stack_namespace=~\"$stack_name\"}[1m])) by (name)) * 100 ",
          "format": "time_series",
          "intervalFactor": 2,
          "legendFormat": "{{name}}",
          "range": true,
          "refId": "A",
          "step": 2
        }
      ],
      "title": "CPU usage by Container (top 10)",
      "type": "timeseries"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "b49a38fd-f343-4ece-942f-03be5cd6a7bf"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "axisCenteredZero": false,
            "axisColorMode": "text",
            "axisLabel": "",
            "axisPlacement": "auto",
            "barAlignment": 0,
            "drawStyle": "line",
            "fillOpacity": 10,
            "gradientMode": "none",
            "hideFrom": {
              "legend": false,
              "tooltip": false,
              "viz": false
            },
            "lineInterpolation": "linear",
            "lineWidth": 1,
            "pointSize": 5,
            "scaleDistribution": {
              "type": "linear"
            },
            "showPoints": "never",
            "spanNulls": true,
            "stacking": {
              "group": "A",
              "mode": "none"
            },
            "thresholdsStyle": {
              "mode": "off"
            }
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green"
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          },
          "unit": "decbytes"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 7,
        "w": 24,
        "x": 0,
        "y": 33
      },
      "id": 24,
      "links": [],
      "options": {
        "legend": {
          "calcs": ["mean", "max", "min"],
          "displayMode": "table",
          "placement": "right",
          "showLegend": true
        },
        "tooltip": {
          "mode": "multi",
          "sort": "none"
        }
      },
      "pluginVersion": "10.0.1",
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "b49a38fd-f343-4ece-942f-03be5cd6a7bf"
          },
          "editorMode": "code",
          "expr": "sum(container_memory_usage_bytes{node_name=~\"$node_name\",container_label_com_docker_stack_namespace=~\"$stack_name\"}) by (container_label_com_docker_swarm_service_name) ",
          "format": "time_series",
          "intervalFactor": 2,
          "legendFormat": "Used {{container_label_com_docker_swarm_service_name}}",
          "range": true,
          "refId": "A",
          "step": 2
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "b49a38fd-f343-4ece-942f-03be5cd6a7bf"
          },
          "editorMode": "code",
          "expr": "sum(container_memory_cache{node_name=~\"$node_name\",container_label_com_docker_stack_namespace=~\"$stack_name\"}) by (container_label_com_docker_swarm_service_name) ",
          "format": "time_series",
          "intervalFactor": 2,
          "legendFormat": "Cached {{container_label_com_docker_swarm_service_name}}",
          "range": true,
          "refId": "B",
          "step": 2
        }
      ],
      "title": "Memory usage by Service",
      "type": "timeseries"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "b49a38fd-f343-4ece-942f-03be5cd6a7bf"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "axisCenteredZero": false,
            "axisColorMode": "text",
            "axisLabel": "",
            "axisPlacement": "auto",
            "barAlignment": 0,
            "drawStyle": "line",
            "fillOpacity": 10,
            "gradientMode": "none",
            "hideFrom": {
              "legend": false,
              "tooltip": false,
              "viz": false
            },
            "lineInterpolation": "linear",
            "lineWidth": 1,
            "pointSize": 5,
            "scaleDistribution": {
              "type": "linear"
            },
            "showPoints": "never",
            "spanNulls": true,
            "stacking": {
              "group": "A",
              "mode": "none"
            },
            "thresholdsStyle": {
              "mode": "off"
            }
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green"
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          },
          "unit": "decbytes"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 7,
        "w": 24,
        "x": 0,
        "y": 40
      },
      "id": 34,
      "links": [],
      "options": {
        "legend": {
          "calcs": ["mean"],
          "displayMode": "table",
          "placement": "right",
          "showLegend": true
        },
        "tooltip": {
          "mode": "multi",
          "sort": "desc"
        }
      },
      "pluginVersion": "10.0.1",
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "b49a38fd-f343-4ece-942f-03be5cd6a7bf"
          },
          "editorMode": "code",
          "expr": "topk(10, avg_over_time(container_memory_usage_bytes{node_name=~\"$node_name\",container_label_com_docker_stack_namespace=~\"$stack_name\"}[1m]))",
          "format": "time_series",
          "intervalFactor": 2,
          "legendFormat": "{{name}}",
          "range": true,
          "refId": "A",
          "step": 2
        }
      ],
      "title": "Memory usage by Container (top 10)",
      "type": "timeseries"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "b49a38fd-f343-4ece-942f-03be5cd6a7bf"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "axisCenteredZero": false,
            "axisColorMode": "text",
            "axisLabel": "",
            "axisPlacement": "auto",
            "barAlignment": 0,
            "drawStyle": "line",
            "fillOpacity": 50,
            "gradientMode": "none",
            "hideFrom": {
              "legend": false,
              "tooltip": false,
              "viz": false
            },
            "lineInterpolation": "linear",
            "lineWidth": 1,
            "pointSize": 5,
            "scaleDistribution": {
              "type": "linear"
            },
            "showPoints": "never",
            "spanNulls": false,
            "stacking": {
              "group": "A",
              "mode": "none"
            },
            "thresholdsStyle": {
              "mode": "off"
            }
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green"
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          },
          "unit": "bytes"
        },
        "overrides": [
          {
            "matcher": {
              "id": "byName",
              "options": "SENT"
            },
            "properties": [
              {
                "id": "color",
                "value": {
                  "fixedColor": "#BF1B00",
                  "mode": "fixed"
                }
              }
            ]
          },
          {
            "matcher": {
              "id": "byValue",
              "options": {
                "op": "gte",
                "reducer": "allIsZero",
                "value": 0
              }
            },
            "properties": [
              {
                "id": "custom.hideFrom",
                "value": {
                  "legend": true,
                  "tooltip": true,
                  "viz": false
                }
              }
            ]
          },
          {
            "matcher": {
              "id": "byValue",
              "options": {
                "op": "gte",
                "reducer": "allIsNull",
                "value": 0
              }
            },
            "properties": [
              {
                "id": "custom.hideFrom",
                "value": {
                  "legend": true,
                  "tooltip": true,
                  "viz": false
                }
              }
            ]
          },
          {
            "matcher": {
              "id": "byType",
              "options": "time"
            },
            "properties": [
              {
                "id": "custom.axisPlacement",
                "value": "hidden"
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 7,
        "w": 12,
        "x": 0,
        "y": 47
      },
      "id": 49,
      "links": [],
      "options": {
        "legend": {
          "calcs": [],
          "displayMode": "list",
          "placement": "bottom",
          "showLegend": false
        },
        "tooltip": {
          "mode": "multi",
          "sort": "none"
        }
      },
      "pluginVersion": "10.0.1",
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "b49a38fd-f343-4ece-942f-03be5cd6a7bf"
          },
          "editorMode": "code",
          "expr": "sum(rate(container_network_receive_bytes_total{node_name=~\"$node_name\",container_label_com_docker_stack_namespace=~\"$stack_name\"}[1m]))",
          "format": "time_series",
          "intervalFactor": 2,
          "legendFormat": "RECEIVED",
          "range": true,
          "refId": "A",
          "step": 240
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "b49a38fd-f343-4ece-942f-03be5cd6a7bf"
          },
          "editorMode": "code",
          "expr": "- sum(rate(container_network_transmit_bytes_total{node_name=~\"$node_name\",container_label_com_docker_stack_namespace=~\"$stack_name\"}[1m]))",
          "format": "time_series",
          "hide": false,
          "intervalFactor": 2,
          "legendFormat": "SENT",
          "range": true,
          "refId": "B",
          "step": 240
        }
      ],
      "title": "Cluster Network Traffic",
      "type": "timeseries"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "b49a38fd-f343-4ece-942f-03be5cd6a7bf"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "axisCenteredZero": false,
            "axisColorMode": "text",
            "axisLabel": "",
            "axisPlacement": "auto",
            "barAlignment": 0,
            "drawStyle": "line",
            "fillOpacity": 10,
            "gradientMode": "none",
            "hideFrom": {
              "legend": false,
              "tooltip": false,
              "viz": false
            },
            "lineInterpolation": "linear",
            "lineWidth": 1,
            "pointSize": 5,
            "scaleDistribution": {
              "type": "linear"
            },
            "showPoints": "never",
            "spanNulls": false,
            "stacking": {
              "group": "A",
              "mode": "none"
            },
            "thresholdsStyle": {
              "mode": "off"
            }
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green"
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          },
          "unit": "short"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 7,
        "w": 12,
        "x": 12,
        "y": 47
      },
      "id": 26,
      "links": [],
      "options": {
        "legend": {
          "calcs": ["mean", "max", "min"],
          "displayMode": "list",
          "placement": "bottom",
          "showLegend": true
        },
        "tooltip": {
          "mode": "multi",
          "sort": "none"
        }
      },
      "pluginVersion": "10.0.1",
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "b49a38fd-f343-4ece-942f-03be5cd6a7bf"
          },
          "editorMode": "code",
          "expr": "sum(irate(container_fs_reads_total{node_name=~\"$node_name\",container_label_com_docker_stack_namespace=~\"$stack_name\"}[1m]) )",
          "format": "time_series",
          "intervalFactor": 2,
          "legendFormat": "Reads",
          "range": true,
          "refId": "A",
          "step": 4
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "b49a38fd-f343-4ece-942f-03be5cd6a7bf"
          },
          "editorMode": "code",
          "expr": "sum(irate(container_fs_writes_total{node_name=~\"$node_name\",container_label_com_docker_stack_namespace=~\"$stack_name\"}[1m])) ",
          "format": "time_series",
          "intervalFactor": 2,
          "legendFormat": "Writes ",
          "range": true,
          "refId": "B",
          "step": 4
        }
      ],
      "title": "Cluster IOPS",
      "type": "timeseries"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "b49a38fd-f343-4ece-942f-03be5cd6a7bf"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "axisCenteredZero": false,
            "axisColorMode": "text",
            "axisLabel": "",
            "axisPlacement": "auto",
            "barAlignment": 0,
            "drawStyle": "line",
            "fillOpacity": 10,
            "gradientMode": "none",
            "hideFrom": {
              "legend": false,
              "tooltip": false,
              "viz": false
            },
            "lineInterpolation": "linear",
            "lineWidth": 1,
            "pointSize": 5,
            "scaleDistribution": {
              "type": "linear"
            },
            "showPoints": "never",
            "spanNulls": false,
            "stacking": {
              "group": "A",
              "mode": "none"
            },
            "thresholdsStyle": {
              "mode": "off"
            }
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green"
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          },
          "unit": "Bps"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 7,
        "w": 24,
        "x": 0,
        "y": 54
      },
      "id": 17,
      "links": [],
      "options": {
        "legend": {
          "calcs": ["mean", "max", "min"],
          "displayMode": "table",
          "placement": "right",
          "showLegend": true
        },
        "tooltip": {
          "mode": "multi",
          "sort": "none"
        }
      },
      "pluginVersion": "10.0.1",
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "b49a38fd-f343-4ece-942f-03be5cd6a7bf"
          },
          "editorMode": "code",
          "expr": "sum(rate(container_network_receive_bytes_total{node_name=~\"$node_name\",container_label_com_docker_stack_namespace=~\"$stack_name\"}[1m])) by (container_label_com_docker_swarm_service_name)",
          "format": "time_series",
          "intervalFactor": 2,
          "legendFormat": "{{container_label_com_docker_swarm_service_name}}",
          "range": true,
          "refId": "A",
          "step": 2
        }
      ],
      "title": "Network received by Service",
      "type": "timeseries"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "b49a38fd-f343-4ece-942f-03be5cd6a7bf"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "axisCenteredZero": false,
            "axisColorMode": "text",
            "axisLabel": "",
            "axisPlacement": "auto",
            "barAlignment": 0,
            "drawStyle": "line",
            "fillOpacity": 10,
            "gradientMode": "none",
            "hideFrom": {
              "legend": false,
              "tooltip": false,
              "viz": false
            },
            "lineInterpolation": "linear",
            "lineWidth": 1,
            "pointSize": 5,
            "scaleDistribution": {
              "type": "linear"
            },
            "showPoints": "never",
            "spanNulls": false,
            "stacking": {
              "group": "A",
              "mode": "none"
            },
            "thresholdsStyle": {
              "mode": "off"
            }
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green"
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          },
          "unit": "Bps"
        },
        "overrides": []
      },
      "gridPos": {
        "h": 7,
        "w": 24,
        "x": 0,
        "y": 61
      },
      "id": 25,
      "links": [],
      "options": {
        "legend": {
          "calcs": ["mean", "max", "min"],
          "displayMode": "table",
          "placement": "right",
          "showLegend": true
        },
        "tooltip": {
          "mode": "multi",
          "sort": "none"
        }
      },
      "pluginVersion": "10.0.1",
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "b49a38fd-f343-4ece-942f-03be5cd6a7bf"
          },
          "editorMode": "code",
          "expr": "sum(rate(container_network_transmit_bytes_total{node_name=~\"$node_name\",container_label_com_docker_stack_namespace=~\"$stack_name\"}[1m])) by (container_label_com_docker_swarm_service_name)",
          "format": "time_series",
          "intervalFactor": 2,
          "legendFormat": "{{container_label_com_docker_swarm_service_name}}",
          "metric": "",
          "range": true,
          "refId": "B",
          "step": 2
        }
      ],
      "title": "Network transmitted by Service",
      "type": "timeseries"
    }
  ],
  "refresh": "30s",
  "schemaVersion": 38,
  "style": "dark",
  "tags": [],
  "templating": {
    "list": [
      {
        "allValue": ".+",
        "current": {
          "selected": false,
          "text": "All",
          "value": "$__all"
        },
        "datasource": {
          "type": "prometheus",
          "uid": "b49a38fd-f343-4ece-942f-03be5cd6a7bf"
        },
        "definition": "label_values(swarm_node_info,node_name)",
        "hide": 0,
        "includeAll": true,
        "label": "Swarm Node",
        "multi": false,
        "name": "node_name",
        "options": [],
        "query": {
          "query": "label_values(swarm_node_info,node_name)",
          "refId": "PrometheusVariableQueryEditor-VariableQuery"
        },
        "refresh": 2,
        "regex": "",
        "skipUrlSync": false,
        "sort": 5,
        "type": "query"
      },
      {
        "current": {
          "selected": false,
          "text": "All",
          "value": "$__all"
        },
        "datasource": {
          "type": "prometheus",
          "uid": "b49a38fd-f343-4ece-942f-03be5cd6a7bf"
        },
        "definition": "label_values(container_tasks_state,container_label_com_docker_stack_namespace)",
        "hide": 0,
        "includeAll": true,
        "label": "Stack",
        "multi": false,
        "name": "stack_name",
        "options": [],
        "query": {
          "query": "label_values(container_tasks_state,container_label_com_docker_stack_namespace)",
          "refId": "PrometheusVariableQueryEditor-VariableQuery"
        },
        "refresh": 1,
        "regex": "",
        "skipUrlSync": false,
        "sort": 1,
        "tagValuesQuery": "",
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      }
    ]
  },
  "time": {
    "from": "now-12h",
    "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": "Docker Swarm Dashboard",
  "uid": "docker-swarm",
  "version": 33,
  "weekStart": ""
}
