K8s: Prometheus结合Grafana监控应用数据及相关配置 (一)

本地部署Grafana+Prometheus Grafana 是一个开源的数据可视化和监控平台,广泛用于分析和展示时序数据(Time Series Data)。它允许用户从多个数据源中提取数据,创建动态仪表板,进行监控和告警,并且具有强大的自定义能力。Grafana 的主要用途是通过美观且易于理解的方式,展示和分析监控数据。 阅读详情

Grafana


1 )概述

  • Prometheus 核心是在于持续数据的存储,然后提供了数据的查询语言 promQL
    • 但是它的显示和图表做的并不好
  • 所以这个时候需要结合业界最专业的做报表展示的Grafana这个组件
    • 它的应用是非常广泛
  • 我们尝试部署 Grafana 来配置日志的一个显示
    • 创建Grafana Dashboard模版相关的configmap
      • 这个模板可以定制一个 Dashboard
      • 也就是说 Grafana 里面的 Dashboard 是通过一个 json 串来定义的
      • 这样就非常灵活,可以细致看下里面的一些字段
    • 部署Grafana Server的 Deployment
      • 原始docker image是grafana/grafana:4.2.0
      • 这里进行一些秘钥的管理,比如用户名和密码
    • 部署Grafana Server的 Service
      • 类型是NodePort,由K8s自由分配
      • 通过 kubectl get service -n monitoring 可以查到分配的端口
      • 可以通过<Node_IP>:<Node_Port>访问Grafana的界面:
      • 缺省登陆用户/密码是 admin/admin
      • 注意:此时还没有添加数据源
    • 为Grafana添加数据源,并创建Dashboard
      • 登录 Grafana 进行 Prometheus 数据源配置
      • 注意:必须在创建Grafana Service之后再运行
      • 进入界面后,点击 Add data source
        • 这里Type 选择 Prometheus
        • url 将之前 Prometheus 的地址填上,比如:http://xx.xx.xx.xx:30091/
        • 点击 add 按钮
      • 切换到 Dashboards 点击 Import 就会把 Prometheus 数据导入
      • 回到主页后发现,数据立马来了
      • 这里报表都是可定制的,监控你想要监控的一些数据
      • 它的模板就是上面json文件导出来的
      • 这个数据是可配置的,点击左上角图标,选择 Data Sources
        • 添加,可配置不同的 Data Source
      • 点击顶部导航栏设置图标,可对报表进行定制
        • 点击 View JSON,在 Variables 栏点击 New
        • 可以增加一个模板,这里可以设置查询条件

2 )一键部署 Grafana

apiVersion: v1
kind: ConfigMap
metadata:
  creationTimestamp: null
  name: grafana-import-dashboards
  namespace: monitoring
data:
  grafana-net-2-dashboard.json: |
    {
      "__inputs": [{
        "name": "DS_PROMETHEUS",
        "label": "Prometheus",
        "description": "",
        "type": "datasource",
        "pluginId": "prometheus",
        "pluginName": "Prometheus"
      }],
      "__requires": [{
        "type": "panel",
        "id": "singlestat",
        "name": "Singlestat",
        "version": ""
      }, {
        "type": "panel",
        "id": "text",
        "name": "Text",
        "version": ""
      }, {
        "type": "panel",
        "id": "graph",
        "name": "Graph",
        "version": ""
      }, {
        "type": "grafana",
        "id": "grafana",
        "name": "Grafana",
        "version": "3.1.0"
      }, {
        "type": "datasource",
        "id": "prometheus",
        "name": "Prometheus",
        "version": "1.0.0"
      }],
      "id": null,
      "title": "Prometheus Stats",
      "tags": [],
      "style": "dark",
      "timezone": "browser",
      "editable": true,
      "hideControls": true,
      "sharedCrosshair": false,
      "rows": [{
        "collapse": false,
        "editable": true,
        "height": 178,
        "panels": [{
          "cacheTimeout": null,
          "colorBackground": false,
          "colorValue": false,
          "colors": ["rgba(245, 54, 54, 0.9)", "rgba(237, 129, 40, 0.89)", "rgba(50, 172, 45, 0.97)"],
          "datasource": "${DS_PROMETHEUS}",
          "decimals": 1,
          "editable": true,
          "error": false,
          "format": "s",
          "id": 5,
          "interval": null,
          "links": [],
          "maxDataPoints": 100,
          "nullPointMode": "connected",
          "nullText": null,
          "postfix": "",
          "postfixFontSize": "50%",
          "prefix": "",
          "prefixFontSize": "50%",
          "span": 3,
          "sparkline": {
            "fillColor": "rgba(31, 118, 189, 0.18)",
            "full": false,
            "lineColor": "rgb(31, 120, 193)",
            "show": false
          },
          "targets": [{
            "expr": "(time() - process_start_time_seconds{job=\"prometheus\"})",
            "intervalFactor": 2,
            "refId": "A",
            "step": 4
          }],
          "thresholds": "",
          "title": "Uptime",
          "type": "singlestat",
          "valueFontSize": "80%",
          "valueMaps": [{
            "op": "=",
            "text": "N/A",
            "value": "null"
          }],
          "valueName": "current",
          "mappingTypes": [{
            "name": "value to text",
            "value": 1
          }, {
            "name": "range to text",
            "value": 2
          }],
          "rangeMaps": [{
            "from": "null",
            "to": "null",
            "text": "N/A"
          }],
          "mappingType": 1,
          "gauge": {
            "show": false,
            "minValue": 0,
            "maxValue": 100,
            "thresholdMarkers": true,
            "thresholdLabels": false
          }
        }, {
          "cacheTimeout": null,
          "colorBackground": false,
          "colorValue": false,
          "colors": ["rgba(50, 172, 45, 0.97)", "rgba(237, 129, 40, 0.89)", "rgba(245, 54, 54, 0.9)"],
          "datasource": "${DS_PROMETHEUS}",
          "editable": true,
          "error": false,
          "format": "none",
          "id": 6,
          "interval": null,
          "links": [],
          "maxDataPoints": 100,
          "nullPointMode": "connected",
          "nullText": null,
          "postfix": "",
          "postfixFontSize": "50%",
          "prefix": "",
          "prefixFontSize": "50%",
          "span": 3,
          "sparkline": {
            "fillColor": "rgba(31, 118, 189, 0.18)",
            "full": false,
            "lineColor": "rgb(31, 120, 193)",
            "show": true
          },
          "targets": [{
            "expr": "prometheus_local_storage_memory_series",
            "intervalFactor": 2,
            "refId": "A",
            "step": 4
          }],
          "thresholds": "1,5",
          "title": "Local Storage Memory Series",
          "type": "singlestat",
          "valueFontSize": "70%",
          "valueMaps": [],
          "valueName": "current",
          "mappingTypes": [{
            "name": "value to text",
            "value": 1
          }, {
            "name": "range to text",
            "value": 2
          }],
          "rangeMaps": [{
            "from": "null",
            "to": "null",
            "text": "N/A"
          }],
          "mappingType": 1,
          "gauge": {
            "show": false,
            "minValue": 0,
            "maxValue": 100,
            "thresholdMarkers": true,
            "thresholdLabels": false
          }
        }, {
          "cacheTimeout": null,
          "colorBackground": false,
          "colorValue": true,
          "colors": ["rgba(50, 172, 45, 0.97)", "rgba(237, 129, 40, 0.89)", "rgba(245, 54, 54, 0.9)"],
          "datasource": "${DS_PROMETHEUS}",
          "editable": true,
          "error": false,
          "format": "none",
          "id": 7,
          "interval": null,
          "links": [],
          "maxDataPoints": 100,
          "nullPointMode": "connected",
          "nullText": null,
          "postfix": "",
          "postfixFontSize": "50%",
          "prefix": "",
          "prefixFontSize": "50%",
          "span": 3,
          "sparkline": {
            "fillColor": "rgba(31, 118, 189, 0.18)",
            "full": false,
            "lineColor": "rgb(31, 120, 193)",
            "show": true
          },
          "targets": [{
            "expr": "prometheus_local_storage_indexing_queue_length",
            "intervalFactor": 2,
            "refId": "A",
            "step": 4
          }],
          "thresholds": "500,4000",
          "title": "Internal Storage Queue Length",
          "type": "singlestat",
          "valueFontSize": "70%",
          "valueMaps": [{
            "op": "=",
            "text": "Empty",
            "value": "0"
          }],
          "valueName": "current",
          "mappingTypes": [{
            "name": "value to text",
            "value": 1
          }, {
            "name": "range to text",
            "value": 2
          }],
          "rangeMaps": [{
            "from": "null",
            "to": "null",
            "text": "N/A"
          }],
          "mappingType": 1,
          "gauge": {
            "show": false,
            "minValue": 0,
            "maxValue": 100,
            "thresholdMarkers": true,
            "thresholdLabels": false
          }
        }, {
          "content": "<img src=\"http://prometheus.io/assets/prometheus_logo_grey.svg\" alt=\"Prometheus logo\" style=\"height: 40px;\">\n<span style=\"font-family: 'Open Sans', 'Helvetica Neue', Helvetica; font-size: 25px;vertical-align: text-top;color: #bbbfc2;margin-left: 10px;\">Prometheus</span>\n\n<p style=\"margin-top: 10px;\">You're using Prometheus, an open-source systems monitoring and alerting toolkit originally built at SoundCloud. For more information, check out the <a href=\"http://www.grafana.org/\">Grafana</a> and <a href=\"http://prometheus.io/\">Prometheus</a> projects.</p>",
          "editable": true,
          "error": false,
          "id": 9,
          "links": [],
          "mode": "html",
          "span": 3,
          "style": {},
          "title": "",
          "transparent": true,
          "type": "text"
        }],
        "title": "New row"
      }, {
        "collapse": false,
        "editable": true,
        "height": 227,
        "panels": [{
          "aliasColors": {
            "prometheus": "#C15C17",
            "{instance=\"localhost:9090\",job=\"prometheus\"}": "#C15C17"
          },
          "bars": false,
          "datasource": "${DS_PROMETHEUS}",
          "editable": true,
          "error": false,
          "fill": 1,
          "grid": {
            "threshold1": null,
            "threshold1Color": "rgba(216, 200, 27, 0.27)",
            "threshold2": null,
            "threshold2Color": "rgba(234, 112, 112, 0.22)"
          },
          "id": 3,
          "legend": {
            "avg": false,
            "current": false,
            "max": false,
            "min": false,
            "show": true,
            "total": false,
            "values": false
          },
          "lines": true,
          "linewidth": 2,
          "links": [],
          "nullPointMode": "connected",
          "percentage": false,
          "pointradius": 2,
          "points": false,
          "renderer": "flot",
          "seriesOverrides": [],
          "span": 9,
          "stack": false,
          "steppedLine": false,
          "targets": [{
            "expr": "rate(prometheus_local_storage_ingested_samples_total[5m])",
            "interval": "",
            "intervalFactor": 2,
            "legendFormat": "{{job}}",
            "metric": "",
            "refId": "A",
            "step": 2
          }],
          "timeFrom": null,
          "timeShift": null,
          "title": "Samples ingested (rate-5m)",
          "tooltip": {
            "shared": true,
            "value_type": "cumulative",
            "ordering": "alphabetical",
            "msResolution": false
          },
          "type": "graph",
          "yaxes": [{
            "show": true,
            "min": null,
            "max": null,
            "logBase": 1,
            "format": "short"
          }, {
            "show": true,
            "min": null,
            "max": null,
            "logBase": 1,
            "format": "short"
          }],
          "xaxis": {
            "show": true
          }
        }, {
          "content": "#### Samples Ingested\nThis graph displays the count of samples ingested by the Prometheus server, as measured over the last 5 minutes, per time series in the range vector. When troubleshooting an issue on IRC or Github, this is often the first stat requested by the Prometheus team. ",
          "editable": true,
          "error": false,
          "id": 8,
          "links": [],
          "mode": "markdown",
          "span": 2.995914043583536,
          "style": {},
          "title": "",
          "transparent": true,
          "type": "text"
        }],
        "title": "New row"
      }, {
        "collapse": false,
        "editable": true,
        "height": "250px",
        "panels": [{
          "aliasColors": {
            "prometheus": "#F9BA8F",
            "{instance=\"localhost:9090\",interval=\"5s\",job=\"prometheus\"}": "#F9BA8F"
          },
          "bars": false,
          "datasource": "${DS_PROMETHEUS}",
          "editable": true,
          "error": false,
          "fill": 1,
          "grid": {
            "threshold1": null,
            "threshold1Color": "rgba(216, 200, 27, 0.27)",
            "threshold2": null,
            "threshold2Color": "rgba(234, 112, 112, 0.22)"
          },
          "id": 2,
          "legend": {
            "avg": false,
            "current": false,
            "max": false,
            "min": false,
            "show": true,
            "total": false,
            "values": false
          },
          "lines": true,
          "linewidth": 2,
          "links": [],
          "nullPointMode": "connected",
          "percentage": false,
          "pointradius": 5,
          "points": false,
          "renderer": "flot",
          "seriesOverrides": [],
          "span": 5,
          "stack": false,
          "steppedLine": false,
          "targets": [{
            "expr": "rate(prometheus_target_interval_length_seconds_count[5m])",
            "intervalFactor": 2,
            "legendFormat": "{{job}}",
            "refId": "A",
            "step": 2
          }],
          "timeFrom": null,
          "timeShift": null,
          "title": "Target Scrapes (last 5m)",
          "tooltip": {
            "shared": true,
            "value_type": "cumulative",
            "ordering": "alphabetical",
            "msResolution": false
          },
          "type": "graph",
          "yaxes": [{
            "show": true,
            "min": null,
            "max": null,
            "logBase": 1,
            "format": "short"
          }, {
            "show": true,
            "min": null,
            "max": null,
            "logBase": 1,
            "format": "short"
          }],
          "xaxis": {
            "show": true
          }
        }, {
          "aliasColors": {},
          "bars": false,
          "datasource": "${DS_PROMETHEUS}",
          "editable": true,
          "error": false,
          "fill": 1,
          "grid": {
            "threshold1": null,
            "threshold1Color": "rgba(216, 200, 27, 0.27)",
            "threshold2": null,
            "threshold2Color": "rgba(234, 112, 112, 0.22)"
          },
          "id": 14,
          "legend": {
            "avg": false,
            "current": false,
            "max": false,
            "min": false,
            "show": true,
            "total": false,
            "values": false
          },
          "lines": true,
          "linewidth": 2,
          "links": [],
          "nullPointMode": "connected",
          "percentage": false,
          "pointradius": 5,
          "points": false,
          "renderer": "flot",
          "seriesOverrides": [],
          "span": 4,
          "stack": false,
          "steppedLine": false,
          "targets": [{
            "expr": "prometheus_target_interval_length_seconds{quantile!=\"0.01\", quantile!=\"0.05\"}",
            "interval": "",
            "intervalFactor": 2,
            "legendFormat": "{{quantile}} ({{interval}})",
            "metric": "",
            "refId": "A",
            "step": 2
          }],
          "timeFrom": null,
          "timeShift": null,
          "title": "Scrape Duration",
          "tooltip": {
            "shared": true,
            "value_type": "cumulative",
            "ordering": "alphabetical",
            "msResolution": false
          },
          "type": "graph",
          "yaxes": [{
            "show": true,
            "min": null,
            "max": null,
            "logBase": 1,
            "format": "short"
          }, {
            "show": true,
            "min": null,
            "max": null,
            "logBase": 1,
            "format": "short"
          }],
          "xaxis": {
            "show": true
          }
        }, {
          "content": "#### Scrapes\nPrometheus scrapes metrics from instrumented jobs, either directly or via an intermediary push gateway for short-lived jobs. Target scrapes will show how frequently targets are scraped, as measured over the last 5 minutes, per time series in the range vector. Scrape Duration will show how long the scrapes are taking, with percentiles available as series. ",
          "editable": true,
          "error": false,
          "id": 11,
          "links": [],
          "mode": "markdown",
          "span": 3,
          "style": {},
          "title": "",
          "transparent": true,
          "type": "text"
        }],
        "title": "New row"
      }, {
        "collapse": false,
        "editable": true,
        "height": "250px",
        "panels": [{
          "aliasColors": {},
          "bars": false,
          "datasource": "${DS_PROMETHEUS}",
          "decimals": null,
          "editable": true,
          "error": false,
          "fill": 1,
          "grid": {
            "threshold1": null,
            "threshold1Color": "rgba(216, 200, 27, 0.27)",
            "threshold2": null,
            "threshold2Color": "rgba(234, 112, 112, 0.22)"
          },
          "id": 12,
          "legend": {
            "alignAsTable": false,
            "avg": false,
            "current": false,
            "hideEmpty": true,
            "max": false,
            "min": false,
            "show": true,
            "total": false,
            "values": false
          },
          "lines": true,
          "linewidth": 2,
          "links": [],
          "nullPointMode": "connected",
          "percentage": false,
          "pointradius": 5,
          "points": false,
          "renderer": "flot",
          "seriesOverrides": [],
          "span": 9,
          "stack": false,
          "steppedLine": false,
          "targets": [{
            "expr": "prometheus_evaluator_duration_milliseconds{quantile!=\"0.01\", quantile!=\"0.05\"}",
            "interval": "",
            "intervalFactor": 2,
            "legendFormat": "{{quantile}}",
            "refId": "A",
            "step": 2
          }],
          "timeFrom": null,
          "timeShift": null,
          "title": "Rule Eval Duration",
          "tooltip": {
            "shared": true,
            "value_type": "cumulative",
            "ordering": "alphabetical",
            "msResolution": false
          },
          "type": "graph",
          "yaxes": [{
            "show": true,
            "min": null,
            "max": null,
            "logBase": 1,
            "format": "percentunit",
            "label": ""
          }, {
            "show": true,
            "min": null,
            "max": null,
            "logBase": 1,
            "format": "short"
          }],
          "xaxis": {
            "show": true
          }
        }, {
          "content": "#### Rule Evaluation Duration\nThis graph panel plots the duration for all evaluations to execute. The 50th percentile, 90th percentile and 99th percentile are shown as three separate series to help identify outliers that may be skewing the data.",
          "editable": true,
          "error": false,
          "id": 15,
          "links": [],
          "mode": "markdown",
          "span": 3,
          "style": {},
          "title": "",
          "transparent": true,
          "type": "text"
        }],
        "title": "New row"
      }],
      "time": {
        "from": "now-5m",
        "to": "now"
      },
      "timepicker": {
        "now": true,
        "refresh_intervals": ["5s", "10s", "30s", "1m", "5m", "15m", "30m", "1h", "2h", "1d"],
        "time_options": ["5m", "15m", "1h", "6h", "12h", "24h", "2d", "7d", "30d"]
      },
      "templating": {
        "list": []
      },
      "annotations": {
        "list": []
      },
      "refresh": false,
      "schemaVersion": 12,
      "version": 0,
      "links": [{
        "icon": "info",
        "tags": [],
        "targetBlank": true,
        "title": "Grafana Docs",
        "tooltip": "",
        "type": "link",
        "url": "http://www.grafana.org/docs"
      }, {
        "icon": "info",
        "tags": [],
        "targetBlank": true,
        "title": "Prometheus Docs",
        "type": "link",
        "url": "http://prometheus.io/docs/introduction/overview/"
      }],
      "gnetId": 2,
      "description": "The  official, pre-built Prometheus Stats Dashboard."
    }
  grafana-net-737-dashboard.json: |
    {
      "__inputs": [{
        "name": "DS_PROMETHEUS",
        "label": "prometheus",
        "description": "",
        "type": "datasource",
        "pluginId": "prometheus",
        "pluginName": "Prometheus"
      }],
      "__requires": [{
        "type": "panel",
        "id": "singlestat",
        "name": "Singlestat",
        "version": ""
      }, {
        "type": "panel",
        "id": "graph",
        "name": "Graph",
        "version": ""
      }, {
        "type": "grafana",
        "id": "grafana",
        "name": "Grafana",
        "version": "3.1.0"
      }, {
        "type": "datasource",
        "id": "prometheus",
        "name": "Prometheus",
        "version": "1.0.0"
      }],
      "id": null,
      "title": "Kubernetes Pod Resources",
      "description": "Shows resource usage of Kubernetes pods.",
      "tags": [
        "kubernetes"
      ],
      "style": "dark",
      "timezone": "browser",
      "editable": true,
      "hideControls": false,
      "sharedCrosshair": false,
      "rows": [{
        "collapse": false,
        "editable": true,
        "height": "250px",
        "panels": [{
          "cacheTimeout": null,
          "colorBackground": false,
          "colorValue": true,
          "colors": [
            "rgba(50, 172, 45, 0.97)",
            "rgba(237, 129, 40, 0.89)",
            "rgba(245, 54, 54, 0.9)"
          ],
          "datasource": "${DS_PROMETHEUS}",
          "editable": true,
          "error": false,
          "format": "percent",
          "gauge": {
            "maxValue": 100,
            "minValue": 0,
            "show": true,
            "thresholdLabels": false,
            "thresholdMarkers": true
          },
          "height": "180px",
          "id": 4,
          "interval": null,
          "isNew": true,
          "links": [],
          "mappingType": 1,
          "mappingTypes": [{
            "name": "value to text",
            "value": 1
          }, {
            "name": "range to text",
            "value": 2
          }],
          "maxDataPoints": 100,
          "nullPointMode": "connected",
          "nullText": null,
          "postfix": "",
          "postfixFontSize": "50%",
          "prefix": "",
          "prefixFontSize": "50%",
          "rangeMaps": [{
            "from": "null",
            "text": "N/A",
            "to": "null"
          }],
          "span": 4,
          "sparkline": {
            "fillColor": "rgba(31, 118, 189, 0.18)",
            "full": false,
            "lineColor": "rgb(31, 120, 193)",
            "show": false
          },
          "targets": [{
            "expr": "sum (container_memory_working_set_bytes{id=\"/\",instance=~\"^$instance$\"}) / sum (machine_memory_bytes{instance=~\"^$instance$\"}) * 100",
            "interval": "",
            "intervalFactor": 2,
            "legendFormat": "",
            "refId": "A",
            "step": 2
          }],
          "thresholds": "65, 90",
          "timeFrom": "1m",
          "timeShift": null,
          "title": "Memory Working Set",
          "transparent": false,
          "type": "singlestat",
          "valueFontSize": "80%",
          "valueMaps": [{
            "op": "=",
            "text": "N/A",
            "value": "null"
          }],
          "valueName": "current"
        }, {
          "cacheTimeout": null,
          "colorBackground": false,
          "colorValue": true,
          "colors": [
            "rgba(50, 172, 45, 0.97)",
            "rgba(237, 129, 40, 0.89)",
            "rgba(245, 54, 54, 0.9)"
          ],
          "datasource": "${DS_PROMETHEUS}",
          "decimals": 2,
          "editable": true,
          "error": false,
          "format": "percent",
          "gauge": {
            "maxValue": 100,
            "minValue": 0,
            "show": true,
            "thresholdLabels": false,
            "thresholdMarkers": true
          },
          "height": "180px",
          "id": 6,
          "interval": null,
          "isNew": true,
          "links": [],
          "mappingType": 1,
          "mappingTypes": [{
            "name": "value to text",
            "value": 1
          }, {
            "name": "range to text",
            "value": 2
          }],
          "maxDataPoints": 100,
          "nullPointMode": "connected",
          "nullText": null,
          "postfix": "",
          "postfixFontSize": "50%",
          "prefix": "",
          "prefixFontSize": "50%",
          "rangeMaps": [{
            "from": "null",
            "text": "N/A",
            "to": "null"
          }],
          "span": 4,
          "sparkline": {
            "fillColor": "rgba(31, 118, 189, 0.18)",
            "full": false,
            "lineColor": "rgb(31, 120, 193)",
            "show": false
          },
          "targets": [{
            "expr": "sum(rate(container_cpu_usage_seconds_total{id=\"/\",instance=~\"^$instance$\"}[1m])) / sum (machine_cpu_cores{instance=~\"^$instance$\"}) * 100",
            "interval": "10s",
            "intervalFactor": 1,
            "refId": "A",
            "step": 10
          }],
          "thresholds": "65, 90",
          "timeFrom": "1m",
          "timeShift": null,
          "title": "Cpu Usage",
          "type": "singlestat",
          "valueFontSize": "80%",
          "valueMaps": [{
            "op": "=",
            "text": "N/A",
            "value": "null"
          }],
          "valueName": "current"
        }, {
          "cacheTimeout": null,
          "colorBackground": false,
          "colorValue": true,
          "colors": [
            "rgba(50, 172, 45, 0.97)",
            "rgba(237, 129, 40, 0.89)",
            "rgba(245, 54, 54, 0.9)"
          ],
          "datasource": "${DS_PROMETHEUS}",
          "decimals": 2,
          "editable": true,
          "error": false,
          "format": "percent",
          "gauge": {
            "maxValue": 100,
            "minValue": 0,
            "show": true,
            "thresholdLabels": false,
            "thresholdMarkers": true
          },
          "height": "180px",
          "id": 7,
          "interval": null,
          "isNew": true,
          "links": [],
          "mappingType": 1,
          "mappingTypes": [{
            "name": "value to text",
            "value": 1
          }, {
            "name": "range to text",
            "value": 2
          }],
          "maxDataPoints": 100,
          "nullPointMode": "connected",
          "nullText": null,
          "postfix": "",
          "postfixFontSize": "50%",
          "prefix": "",
          "prefixFontSize": "50%",
          "rangeMaps": [{
            "from": "null",
            "text": "N/A",
            "to": "null"
          }],
          "span": 4,
          "sparkline": {
            "fillColor": "rgba(31, 118, 189, 0.18)",
            "full": false,
            "lineColor": "rgb(31, 120, 193)",
            "show": false
          },
          "targets": [{
            "expr": "sum(container_fs_usage_bytes{id=\"/\",instance=~\"^$instance$\"}) / sum(container_fs_limit_bytes{id=\"/\",instance=~\"^$instance$\"}) * 100",
            "interval": "10s",
            "intervalFactor": 1,
            "legendFormat": "",
            "metric": "",
            "refId": "A",
            "step": 10
          }],
          "thresholds": "65, 90",
          "timeFrom": "1m",
          "timeShift": null,
          "title": "Filesystem Usage",
          "type": "singlestat",
          "valueFontSize": "80%",
          "valueMaps": [{
            "op": "=",
            "text": "N/A",
            "value": "null"
          }],
          "valueName": "current"
        }, {
          "cacheTimeout": null,
          "colorBackground": false,
          "colorValue": false,
          "colors": [
            "rgba(50, 172, 45, 0.97)",
            "rgba(237, 129, 40, 0.89)",
            "rgba(245, 54, 54, 0.9)"
          ],
          "datasource": "${DS_PROMETHEUS}",
          "decimals": 2,
          "editable": true,
          "error": false,
          "format": "bytes",
          "gauge": {
            "maxValue": 100,
            "minValue": 0,
            "show": false,
            "thresholdLabels": false,
            "thresholdMarkers": true
          },
          "height": "1px",
          "hideTimeOverride": true,
          "id": 9,
          "interval": null,
          "isNew": true,
          "links": [],
          "mappingType": 1,
          "mappingTypes": [{
            "name": "value to text",
            "value": 1
          }, {
            "name": "range to text",
            "value": 2
          }],
          "maxDataPoints": 100,
          "nullPointMode": "connected",
          "nullText": null,
          "postfix": "",
          "postfixFontSize": "20%",
          "prefix": "",
          "prefixFontSize": "20%",
          "rangeMaps": [{
            "from": "null",
            "text": "N/A",
            "to": "null"
          }],
          "span": 2,
          "sparkline": {
            "fillColor": "rgba(31, 118, 189, 0.18)",
            "full": false,
            "lineColor": "rgb(31, 120, 193)",
            "show": false
          },
          "targets": [{
            "expr": "sum(container_memory_working_set_bytes{id=\"/\",instance=~\"^$instance$\"})",
            "interval": "10s",
            "intervalFactor": 1,
            "refId": "A",
            "step": 10
          }],
          "thresholds": "",
          "timeFrom": "1m",
          "title": "Used",
          "type": "singlestat",
          "valueFontSize": "50%",
          "valueMaps": [{
            "op": "=",
            "text": "N/A",
            "value": "null"
          }],
          "valueName": "current"
        }, {
          "cacheTimeout": null,
          "colorBackground": false,
          "colorValue": false,
          "colors": [
            "rgba(50, 172, 45, 0.97)",
            "rgba(237, 129, 40, 0.89)",
            "rgba(245, 54, 54, 0.9)"
          ],
          "datasource": "${DS_PROMETHEUS}",
          "decimals": 2,
          "editable": true,
          "error": false,
          "format": "bytes",
          "gauge": {
            "maxValue": 100,
            "minValue": 0,
            "show": false,
            "thresholdLabels": false,
            "thresholdMarkers": true
          },
          "height": "1px",
          "hideTimeOverride": true,
          "id": 10,
          "interval": null,
          "isNew": true,
          "links": [],
          "mappingType": 1,
          "mappingTypes": [{
            "name": "value to text",
            "value": 1
          }, {
            "name": "range to text",
            "value": 2
          }],
          "maxDataPoints": 100,
          "nullPointMode": "connected",
          "nullText": null,
          "postfix": "",
          "postfixFontSize": "50%",
          "prefix": "",
          "prefixFontSize": "50%",
          "rangeMaps": [{
            "from": "null",
            "text": "N/A",
            "to": "null"
          }],
          "span": 2,
          "sparkline": {
            "fillColor": "rgba(31, 118, 189, 0.18)",
            "full": false,
            "lineColor": "rgb(31, 120, 193)",
            "show": false
          },
          "targets": [{
            "expr": "sum (machine_memory_bytes{instance=~\"^$instance$\"})",
            "interval": "10s",
            "intervalFactor": 1,
            "refId": "A",
            "step": 10
          }],
          "thresholds": "",
          "timeFrom": "1m",
          "title": "Total",
          "type": "singlestat",
          "valueFontSize": "50%",
          "valueMaps": [{
            "op": "=",
            "text": "N/A",
            "value": "null"
          }],
          "valueName": "current"
        }, {
          "cacheTimeout": null,
          "colorBackground": false,
          "colorValue": false,
          "colors": [
            "rgba(50, 172, 45, 0.97)",
            "rgba(237, 129, 40, 0.89)",
            "rgba(245, 54, 54, 0.9)"
          ],
          "datasource": "${DS_PROMETHEUS}",
          "decimals": 2,
          "editable": true,
          "error": false,
          "format": "none",
          "gauge": {
            "maxValue": 100,
            "minValue": 0,
            "show": false,
            "thresholdLabels": false,
            "thresholdMarkers": true
          },
          "height": "1px",
          "hideTimeOverride": true,
          "id": 11,
          "interval": null,
          "isNew": true,
          "links": [],
          "mappingType": 1,
          "mappingTypes": [{
            "name": "value to text",
            "value": 1
          }, {
            "name": "range to text",
            "value": 2
          }],
          "maxDataPoints": 100,
          "nullPointMode": "connected",
          "nullText": null,
          "postfix": " cores",
          "postfixFontSize": "30%",
          "prefix": "",
          "prefixFontSize": "50%",
          "rangeMaps": [{
            "from": "null",
            "text": "N/A",
            "to": "null"
          }],
          "span": 2,
          "sparkline": {
            "fillColor": "rgba(31, 118, 189, 0.18)",
            "full": false,
            "lineColor": "rgb(31, 120, 193)",
            "show": false
          },
          "targets": [{
            "expr": "sum (rate (container_cpu_usage_seconds_total{id=\"/\",instance=~\"^$instance$\"}[1m]))",
            "interval": "10s",
            "intervalFactor": 1,
            "refId": "A",
            "step": 10
          }],
          "thresholds": "",
          "timeFrom": "1m",
          "timeShift": null,
          "title": "Used",
          "type": "singlestat",
          "valueFontSize": "50%",
          "valueMaps": [{
            "op": "=",
            "text": "N/A",
            "value": "null"
          }],
          "valueName": "current"
        }, {
          "cacheTimeout": null,
          "colorBackground": false,
          "colorValue": false,
          "colors": [
            "rgba(50, 172, 45, 0.97)",
            "rgba(237, 129, 40, 0.89)",
            "rgba(245, 54, 54, 0.9)"
          ],
          "datasource": "${DS_PROMETHEUS}",
          "decimals": 2,
          "editable": true,
          "error": false,
          "format": "none",
          "gauge": {
            "maxValue": 100,
            "minValue": 0,
            "show": false,
            "thresholdLabels": false,
            "thresholdMarkers": true
          },
          "height": "1px",
          "hideTimeOverride": true,
          "id": 12,
          "interval": null,
          "isNew": true,
          "links": [],
          "mappingType": 1,
          "mappingTypes": [{
            "name": "value to text",
            "value": 1
          }, {
            "name": "range to text",
            "value": 2
          }],
          "maxDataPoints": 100,
          "nullPointMode": "connected",
          "nullText": null,
          "postfix": " cores",
          "postfixFontSize": "30%",
          "prefix": "",
          "prefixFontSize": "50%",
          "rangeMaps": [{
            "from": "null",
            "text": "N/A",
            "to": "null"
          }],
          "span": 2,
          "sparkline": {
            "fillColor": "rgba(31, 118, 189, 0.18)",
            "full": false,
            "lineColor": "rgb(31, 120, 193)",
            "show": false
          },
          "targets": [{
            "expr": "sum (machine_cpu_cores{instance=~\"^$instance$\"})",
            "interval": "10s",
            "intervalFactor": 1,
            "refId": "A",
            "step": 10
          }],
          "thresholds": "",
          "timeFrom": "1m",
          "title": "Total",
          "type": "singlestat",
          "valueFontSize": "50%",
          "valueMaps": [{
            "op": "=",
            "text": "N/A",
            "value": "null"
          }],
          "valueName": "current"
        }, {
          "cacheTimeout": null,
          "colorBackground": false,
          "colorValue": false,
          "colors": [
            "rgba(50, 172, 45, 0.97)",
            "rgba(237, 129, 40, 0.89)",
            "rgba(245, 54, 54, 0.9)"
          ],
          "datasource": "${DS_PROMETHEUS}",
          "decimals": 2,
          "editable": true,
          "error": false,
          "format": "bytes",
          "gauge": {
            "maxValue": 100,
            "minValue": 0,
            "show": false,
            "thresholdLabels": false,
            "thresholdMarkers": true
          },
          "height": "1px",
          "hideTimeOverride": true,
          "id": 13,
          "interval": null,
          "isNew": true,
          "links": [],
          "mappingType": 1,
          "mappingTypes": [{
            "name": "value to text",
            "value": 1
          }, {
            "name": "range to text",
            "value": 2
          }],
          "maxDataPoints": 100,
          "nullPointMode": "connected",
          "nullText": null,
          "postfix": "",
          "postfixFontSize": "50%",
          "prefix": "",
          "prefixFontSize": "50%",
          "rangeMaps": [{
            "from": "null",
            "text": "N/A",
            "to": "null"
          }],
          "span": 2,
          "sparkline": {
            "fillColor": "rgba(31, 118, 189, 0.18)",
            "full": false,
            "lineColor": "rgb(31, 120, 193)",
            "show": false
          },
          "targets": [{
            "expr": "sum(container_fs_usage_bytes{id=\"/\",instance=~\"^$instance$\"})",
            "interval": "10s",
            "intervalFactor": 1,
            "refId": "A",
            "step": 10
          }],
          "thresholds": "",
          "timeFrom": "1m",
          "title": "Used",
          "type": "singlestat",
          "valueFontSize": "50%",
          "valueMaps": [{
            "op": "=",
            "text": "N/A",
            "value": "null"
          }],
          "valueName": "current"
        }, {
          "cacheTimeout": null,
          "colorBackground": false,
          "colorValue": false,
          "colors": [
            "rgba(50, 172, 45, 0.97)",
            "rgba(237, 129, 40, 0.89)",
            "rgba(245, 54, 54, 0.9)"
          ],
          "datasource": "${DS_PROMETHEUS}",
          "decimals": 2,
          "editable": true,
          "error": false,
          "format": "bytes",
          "gauge": {
            "maxValue": 100,
            "minValue": 0,
            "show": false,
            "thresholdLabels": false,
            "thresholdMarkers": true
          },
          "height": "1px",
          "hideTimeOverride": true,
          "id": 14,
          "interval": null,
          "isNew": true,
          "links": [],
          "mappingType": 1,
          "mappingTypes": [{
            "name": "value to text",
            "value": 1
          }, {
            "name": "range to text",
            "value": 2
          }],
          "maxDataPoints": 100,
          "nullPointMode": "connected",
          "nullText": null,
          "postfix": "",
          "postfixFontSize": "50%",
          "prefix": "",
          "prefixFontSize": "50%",
          "rangeMaps": [{
            "from": "null",
            "text": "N/A",
            "to": "null"
          }],
          "span": 2,
          "sparkline": {
            "fillColor": "rgba(31, 118, 189, 0.18)",
            "full": false,
            "lineColor": "rgb(31, 120, 193)",
            "show": false
          },
          "targets": [{
            "expr": "sum (container_fs_limit_bytes{id=\"/\",instance=~\"^$instance$\"})",
            "interval": "10s",
            "intervalFactor": 1,
            "refId": "A",
            "step": 10
          }],
          "thresholds": "",
          "timeFrom": "1m",
          "title": "Total",
          "type": "singlestat",
          "valueFontSize": "50%",
          "valueMaps": [{
            "op": "=",
            "text": "N/A",
            "value": "null"
          }],
          "valueName": "current"
        }, {
          "aliasColors": {},
          "bars": false,
          "datasource": "${DS_PROMETHEUS}",
          "decimals": 2,
          "editable": true,
          "error": false,
          "fill": 1,
          "grid": {
            "threshold1": null,
            "threshold1Color": "rgba(216, 200, 27, 0.27)",
            "threshold2": null,
            "threshold2Color": "rgba(234, 112, 112, 0.22)",
            "thresholdLine": false
          },
          "height": "200px",
          "id": 32,
          "isNew": true,
          "legend": {
            "alignAsTable": true,
            "avg": true,
            "current": true,
            "max": false,
            "min": false,
            "rightSide": true,
            "show": true,
            "sideWidth": 200,
            "sort": "current",
            "sortDesc": true,
            "total": false,
            "values": true
          },
          "lines": true,
          "linewidth": 2,
          "links": [],
          "nullPointMode": "connected",
          "percentage": false,
          "pointradius": 5,
          "points": false,
          "renderer": "flot",
          "seriesOverrides": [],
          "span": 12,
          "stack": false,
          "steppedLine": false,
          "targets": [{
            "expr": "sum(rate(container_network_receive_bytes_total{instance=~\"^$instance$\",namespace=~\"^$namespace$\"}[1m]))",
            "interval": "",
            "intervalFactor": 2,
            "legendFormat": "receive",
            "metric": "network",
            "refId": "A",
            "step": 240
          }, {
            "expr": "- sum(rate(container_network_transmit_bytes_total{instance=~\"^$instance$\",namespace=~\"^$namespace$\"}[1m]))",
            "interval": "",
            "intervalFactor": 2,
            "legendFormat": "transmit",
            "metric": "network",
            "refId": "B",
            "step": 240
          }],
          "timeFrom": null,
          "timeShift": null,
          "title": "Network",
          "tooltip": {
            "msResolution": false,
            "shared": true,
            "sort": 0,
            "value_type": "cumulative"
          },
          "transparent": false,
          "type": "graph",
          "xaxis": {
            "show": true
          },
          "yaxes": [{
            "format": "Bps",
            "label": "transmit / receive",
            "logBase": 1,
            "max": null,
            "min": null,
            "show": true
          }, {
            "format": "Bps",
            "label": null,
            "logBase": 1,
            "max": null,
            "min": null,
            "show": false
          }]
        }],
        "showTitle": true,
        "title": "all pods"
      }, {
        "collapse": false,
        "editable": true,
        "height": "250px",
        "panels": [{
          "aliasColors": {},
          "bars": false,
          "datasource": "${DS_PROMETHEUS}",
          "decimals": 3,
          "editable": true,
          "error": false,
          "fill": 0,
          "grid": {
            "threshold1": null,
            "threshold1Color": "rgba(216, 200, 27, 0.27)",
            "threshold2": null,
            "threshold2Color": "rgba(234, 112, 112, 0.22)"
          },
          "height": "",
          "id": 17,
          "isNew": true,
          "legend": {
            "alignAsTable": true,
            "avg": true,
            "current": true,
            "hideEmpty": true,
            "hideZero": true,
            "max": false,
            "min": false,
            "rightSide": true,
            "show": true,
            "sideWidth": null,
            "sort": "current",
            "sortDesc": true,
            "total": false,
            "values": true
          },
          "lines": true,
          "linewidth": 2,
          "links": [],
          "nullPointMode": "connected",
          "percentage": false,
          "pointradius": 5,
          "points": false,
          "renderer": "flot",
          "seriesOverrides": [],
          "span": 12,
          "stack": false,
          "steppedLine": false,
          "targets": [{
            "expr": "sum(rate(container_cpu_usage_seconds_total{image!=\"\",name=~\"^k8s_.*\"}[1m])) by (pod_name)",
            "interval": "",
            "intervalFactor": 2,
            "legendFormat": "{{ pod_name }}",
            "metric": "container_cpu",
            "refId": "A",
            "step": 240
          }],
          "timeFrom": null,
          "timeShift": null,
          "title": "Cpu Usage",
          "tooltip": {
            "msResolution": true,
            "shared": false,
            "sort": 2,
            "value_type": "cumulative"
          },
          "transparent": false,
          "type": "graph",
          "xaxis": {
            "show": true
          },
          "yaxes": [{
            "format": "none",
            "label": "cores",
            "logBase": 1,
            "max": null,
            "min": null,
            "show": true
          }, {
            "format": "short",
            "label": null,
            "logBase": 1,
            "max": null,
            "min": null,
            "show": false
          }]
        }, {
          "aliasColors": {},
          "bars": false,
          "datasource": "${DS_PROMETHEUS}",
          "decimals": 2,
          "editable": true,
          "error": false,
          "fill": 0,
          "grid": {
            "threshold1": null,
            "threshold1Color": "rgba(216, 200, 27, 0.27)",
            "threshold2": null,
            "threshold2Color": "rgba(234, 112, 112, 0.22)"
          },
          "id": 33,
          "isNew": true,
          "legend": {
            "alignAsTable": true,
            "avg": true,
            "current": true,
            "hideEmpty": true,
            "hideZero": true,
            "max": false,
            "min": false,
            "rightSide": true,
            "show": true,
            "sideWidth": null,
            "sort": "current",
            "sortDesc": true,
            "total": false,
            "values": true
          },
          "lines": true,
          "linewidth": 2,
          "links": [],
          "nullPointMode": "null",
          "percentage": false,
          "pointradius": 5,
          "points": false,
          "renderer": "flot",
          "seriesOverrides": [],
          "span": 12,
          "stack": false,
          "steppedLine": false,
          "targets": [{
            "expr": "sum (container_memory_working_set_bytes{image!=\"\",name=~\"^k8s_.*\",instance=~\"^$instance$\",namespace=~\"^$namespace$\"}) by (pod_name)",
            "interval": "",
            "intervalFactor": 2,
            "legendFormat": "{{ pod_name }}",
            "metric": "",
            "refId": "A",
            "step": 240
          }],
          "timeFrom": null,
          "timeShift": null,
          "title": "Memory Working Set",
          "tooltip": {
            "msResolution": false,
            "shared": false,
            "sort": 2,
            "value_type": "cumulative"
          },
          "type": "graph",
          "xaxis": {
            "show": true
          },
          "yaxes": [{
            "format": "bytes",
            "label": "used",
            "logBase": 1,
            "max": null,
            "min": null,
            "show": true
          }, {
            "format": "short",
            "label": null,
            "logBase": 1,
            "max": null,
            "min": null,
            "show": false
          }]
        }, {
          "aliasColors": {},
          "bars": false,
          "datasource": "${DS_PROMETHEUS}",
          "decimals": 2,
          "editable": true,
          "error": false,
          "fill": 1,
          "grid": {
            "threshold1": null,
            "threshold1Color": "rgba(216, 200, 27, 0.27)",
            "threshold2": null,
            "threshold2Color": "rgba(234, 112, 112, 0.22)"
          },
          "id": 16,
          "isNew": true,
          "legend": {
            "alignAsTable": true,
            "avg": true,
            "current": true,
            "hideEmpty": true,
            "hideZero": true,
            "max": false,
            "min": false,
            "rightSide": true,
            "show": true,
            "sideWidth": 200,
            "sort": "avg",
            "sortDesc": true,
            "total": false,
            "values": true
          },
          "lines": true,
          "linewidth": 2,
          "links": [],
          "nullPointMode": "null",
          "percentage": false,
          "pointradius": 5,
          "points": false,
          "renderer": "flot",
          "seriesOverrides": [],
          "span": 12,
          "stack": false,
          "steppedLine": false,
          "targets": [{
            "expr": "sum (rate (container_network_receive_bytes_total{image!=\"\",name=~\"^k8s_.*\",instance=~\"^$instance$\",namespace=~\"^$namespace$\"}[1m])) by (pod_name)",
            "interval": "",
            "intervalFactor": 2,
            "legendFormat": "{{ pod_name }} < in",
            "metric": "network",
            "refId": "A",
            "step": 240
          }, {
            "expr": "- sum (rate (container_network_transmit_bytes_total{image!=\"\",name=~\"^k8s_.*\",instance=~\"^$instance$\",namespace=~\"^$namespace$\"}[1m])) by (pod_name)",
            "interval": "",
            "intervalFactor": 2,
            "legendFormat": "{{ pod_name }} > out",
            "metric": "network",
            "refId": "B",
            "step": 240
          }],
          "timeFrom": null,
          "timeShift": null,
          "title": "Network",
          "tooltip": {
            "msResolution": false,
            "shared": false,
            "sort": 2,
            "value_type": "cumulative"
          },
          "type": "graph",
          "xaxis": {
            "show": true
          },
          "yaxes": [{
            "format": "Bps",
            "label": "transmit / receive",
            "logBase": 1,
            "max": null,
            "min": null,
            "show": true
          }, {
            "format": "short",
            "label": null,
            "logBase": 1,
            "max": null,
            "min": null,
            "show": false
          }]
        }, {
          "aliasColors": {},
          "bars": false,
          "datasource": "${DS_PROMETHEUS}",
          "decimals": 2,
          "editable": true,
          "error": false,
          "fill": 1,
          "grid": {
            "threshold1": null,
            "threshold1Color": "rgba(216, 200, 27, 0.27)",
            "threshold2": null,
            "threshold2Color": "rgba(234, 112, 112, 0.22)"
          },
          "id": 34,
          "isNew": true,
          "legend": {
            "alignAsTable": true,
            "avg": true,
            "current": true,
            "hideEmpty": true,
            "hideZero": true,
            "max": false,
            "min": false,
            "rightSide": true,
            "show": true,
            "sideWidth": 200,
            "sort": "current",
            "sortDesc": true,
            "total": false,
            "values": true
          },
          "lines": true,
          "linewidth": 2,
          "links": [],
          "nullPointMode": "null",
          "percentage": false,
          "pointradius": 5,
          "points": false,
          "renderer": "flot",
          "seriesOverrides": [],
          "span": 12,
          "stack": false,
          "steppedLine": false,
          "targets": [{
            "expr": "sum(container_fs_usage_bytes{image!=\"\",name=~\"^k8s_.*\",instance=~\"^$instance$\",namespace=~\"^$namespace$\"}) by (pod_name)",
            "interval": "",
            "intervalFactor": 2,
            "legendFormat": "{{ pod_name }}",
            "metric": "network",
            "refId": "A",
            "step": 240
          }],
          "timeFrom": null,
          "timeShift": null,
          "title": "Filesystem",
          "tooltip": {
            "msResolution": false,
            "shared": false,
            "sort": 2,
            "value_type": "cumulative"
          },
          "type": "graph",
          "xaxis": {
            "show": true
          },
          "yaxes": [{
            "format": "bytes",
            "label": "used",
            "logBase": 1,
            "max": null,
            "min": null,
            "show": true
          }, {
            "format": "short",
            "label": null,
            "logBase": 1,
            "max": null,
            "min": null,
            "show": false
          }]
        }],
        "showTitle": true,
        "title": "each pod"
      }],
      "time": {
        "from": "now-3d",
        "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"
        ]
      },
      "templating": {
        "list": [{
          "allValue": ".*",
          "current": {},
          "datasource": "${DS_PROMETHEUS}",
          "hide": 0,
          "includeAll": true,
          "label": "Instance",
          "multi": false,
          "name": "instance",
          "options": [],
          "query": "label_values(instance)",
          "refresh": 1,
          "regex": "",
          "type": "query"
        }, {
          "current": {},
          "datasource": "${DS_PROMETHEUS}",
          "hide": 0,
          "includeAll": true,
          "label": "Namespace",
          "multi": true,
          "name": "namespace",
          "options": [],
          "query": "label_values(namespace)",
          "refresh": 1,
          "regex": "",
          "type": "query"
        }]
      },
      "annotations": {
        "list": []
      },
      "refresh": false,
      "schemaVersion": 12,
      "version": 8,
      "links": [],
      "gnetId": 737
    }
  prometheus-datasource.json: |
    {
      "name": "prometheus",
      "type": "prometheus",
      "url": "http://prometheus:9090",
      "access": "proxy",
      "basicAuth": false
    }
---
apiVersion: v1
kind: Service
metadata:
  name: grafana
  namespace: monitoring
  labels:
    app: grafana
    component: core
spec:
  type: NodePort
  ports:
    - port: 3000
  selector:
    app: grafana
    component: core
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: grafana-core
  namespace: monitoring
  labels:
    app: grafana
    component: core
spec:
  replicas: 1
  selector:
    matchLabels:
      app: grafana
      component: core
  template:
    metadata:
      labels:
        app: grafana
        component: core
    spec:
      containers:
#     - image: grafana/grafana:4.2.0
      - image: grafana/grafana:4.2.0
        name: grafana-core
        imagePullPolicy: IfNotPresent
        # env:
        resources:
          # keep request = limit to keep this container in guaranteed class
          limits:
            cpu: 100m
            memory: 100Mi
          requests:
            cpu: 100m
            memory: 100Mi
        env:
          # The following env variables set up basic auth twith the default admin user and admin password.
          - name: GF_AUTH_BASIC_ENABLED
            value: "true"
          - name: GF_SECURITY_ADMIN_USER
            valueFrom:
              secretKeyRef:
                name: grafana
                key: admin-username
          - name: GF_SECURITY_ADMIN_PASSWORD
            valueFrom:
              secretKeyRef:
                name: grafana
                key: admin-password
          - name: GF_AUTH_ANONYMOUS_ENABLED
            value: "false"
          # - name: GF_AUTH_ANONYMOUS_ORG_ROLE
          #   value: Admin
          # does not really work, because of template variables in exported dashboards:
          # - name: GF_DASHBOARDS_JSON_ENABLED
          #   value: "true"
        readinessProbe:
          httpGet:
            path: /login
            port: 3000
          # initialDelaySeconds: 30
          # timeoutSeconds: 1
        volumeMounts:
        - name: grafana-persistent-storage
          mountPath: /var/lib/grafana
      volumes:
      - name: grafana-persistent-storage
        emptyDir: {}
---
apiVersion: batch/v1
kind: Job
metadata:
  name: grafana-import-dashboards
  namespace: monitoring
  labels:
    app: grafana
    component: import-dashboards
spec:
  template:
    metadata:
      name: grafana-import-dashboards
      labels:
        app: grafana
        component: import-dashboards
    spec:
      serviceAccountName: prometheus-k8s
      initContainers:
      - name: wait-for-grafana
#       image: giantswarm/tiny-tools
        image: giantswarm/tiny-tools
        args:
        - /bin/sh
        - -c
        - >
          set -x;
          while [ $(curl -sw '%{http_code}' "http://grafana:3000" -o /dev/null) -ne 200]; do
            echo '.'
            sleep 15;
          done
      containers:
      - name: grafana-import-dashboards
#       image: giantswarm/tiny-tools      
        image: giantswarm/tiny-tools
        command: ["/bin/sh", "-c"]
        workingDir: /opt/grafana-import-dashboards
        args:
          - >
            for file in *-datasource.json ; do
              if [ -e "$file" ] ; then
                echo "importing $file" &&
                curl --silent --fail --show-error \
                  --request POST http://${GF_ADMIN_USER}:${GF_ADMIN_PASSWORD}@grafana:3000/api/datasources \
                  --header "Content-Type: application/json" \
                  --data-binary "@$file" ;
                echo "" ;
              fi
            done ;
            for file in *-dashboard.json ; do
              if [ -e "$file" ] ; then
                echo "importing $file" &&
                ( echo '{"dashboard":'; \
                  cat "$file"; \
                  echo ',"overwrite":true,"inputs":[{"name":"DS_PROMETHEUS","type":"datasource","pluginId":"prometheus","value":"prometheus"}]}' ) \
                | jq -c '.' \
                | curl --silent --fail --show-error \
                  --request POST http://${GF_ADMIN_USER}:${GF_ADMIN_PASSWORD}@grafana:3000/api/dashboards/import \
                  --header "Content-Type: application/json" \
                  --data-binary "@-" ;
                echo "" ;
              fi
            done

        env:
        - name: GF_ADMIN_USER
          valueFrom:
            secretKeyRef:
              name: grafana
              key: admin-username
        - name: GF_ADMIN_PASSWORD
          valueFrom:
            secretKeyRef:
              name: grafana
              key: admin-password
        volumeMounts:
        - name: config-volume
          mountPath: /opt/grafana-import-dashboards
      restartPolicy: Never
      volumes:
      - name: config-volume
        configMap:
          name: grafana-import-dashboards
  • 这个仅供临时参考,后面会重新部署
【Prometheus】【实战篇(七)】在 Grafana 中配置数据源并使用 Prometheus Node Exporter 通过 Grafana 配置 Prometheus 数据源并导入 Node Exporter 仪表盘,可以实现对主机监控数据的可视化展示。仪表盘可以展示各种指标,如 CPU、内存、磁盘等资源的使用情况,并通过 Grafana 的图表和报警功能监控系统性能。 阅读详情

相关推荐

Grafana中添加Prometheus数据源

图中的三个模板是Grafana自带的模板,点击任意一个就可以使用。如果当前模板不是自己想要的或者想换其他模板,可以其官网下载。这时需要修改报错的信息,这些信息都是自己可以自定义修改的。添加好后使用模板,按照如下图所示点击新添加的模板。Connection是必须要填写的,填写。如下图:在这两个地方都可以添加模板,点击。选择任意日期的模板下载,下载后的格式是。展示效果如下,和官网的一样。在左侧功能目录中,依次找到。可以默认,亦可以自定义。服务器的地址和端口(默认。其他选择默认,在最后点击。,填写数据源的信息。

lht631935612的博客 1961

Grafana安装和配置Prometheus数据源教程

Grafana是用于可视化大型测量数据的开源程序,他提供了强大和优雅的方式去创建、共享、浏览数据。dashboard中显示了你不同metric数据源中的数据。

BaiYZ的Blog 1万+

云原生Spring Boot应用配置Prometheus+Grafana监控(保姆级)

最近想要配置Spring Boot应用Prometheus+Grafana监控的demo,发现网上的很多中英文资料,内容过时或者配置不对。 因此写一个文章来说明整个体系是怎么工作的。 Demo的源码地址: https://github.com/hengyunabc/spring-boot-prometheus-grafana-demo spring boot应用metrics配置 首先,我们直接到官网创建一个spring boot demo应用: https://start.sprin

SharingOfficer的博客 1290

Prometheus+Grafana基础介绍及搭建使用

企业级监控平台,超详细

h16678481的博客 1万+

《Kubernetes监控篇:Prometheus+Grafana+Alertmanager监控K8S集群实战》

系列文章目录 提示:这里可以添加系列文章的所有文章的目录,目录需要自己手动添加 例如:第一章 Python 机器学习入门之pandas的使用 提示:写完文章后,目录可以自动生成,如何生成可参考右边的帮助文档 文章目录系列文章目录前言一、pandas是什么?二、使用步骤1.引入库2.读入数据总结 前言 提示:这里可以添加本文要记录的大概内容: 例如:随着人工智能的不断发展,机器学习这门技术也越来越重要,很多人都开启了学习机器学习,本文就介绍了机器学习的基础内容。 提示:以下是本篇文章正文内容,下面案例

东城绝神 4896

kubernetes部署prometheus监控

kubernetes部署prometheus监控

2302_81167603的博客 1705

K8s: Prometheus结合Grafana监控应用数据及相关配置 (三)

启动起来之后,可以留意一下 2 )一键部署部署这个文件之前,可以先清理之前在这个命名空间,重新进行部署现在编写这个文件 $ 注意,下面两个 job_name 下定义的 target 地址 换成自己的 $ 编写 grafana 配置 部署 Grafana $ 上面两套都部署完成后,验证状态访问 Grafana UI界面 ip:30982 登录 添加 DataSource之后进行 Grafana Dashboard 的配置,现在换一个监控的模板数据面板会有延时,也可自行刷新查看,每个指标都是配置

Wang的专栏 1847

基于Grafana+Prometheus实现k8s上的SpringBoot工程JVM监控

一文教你部署在k8s上面的springboot应用如何实时监控硬件状态、JVM状态。

富强说 4329

K8s: Prometheus结合Grafana监控应用数据及相关配置 (二)

重新打包和部署 之后重新打包 $ mvn package 登录到私有镜像中心 $ docker login 10.211.10.2:8081 构建镜像 $ docker build -t 10.211.10.2:8081/docker/k8sblog:1.4 . 给镜像添加tag $ docker tag 10.211.10.2:8081/docker/k8sblog:1.4 10.211.10.2:8081/docker/k8sblog:latest 同步 latest 推送到私有镜像中心 $ dock

Wang的专栏 432

《kubernetes》Prometheus监控

本文介绍了在Kubernetes集群中部署Prometheus+Grafana监控系统的完整方案。主要内容包括:1)Prometheus监控系统架构及组件解析,包括server、node_exporter等;2)详细部署步骤:创建Prometheus Deployment/Service/ConfigMap/RBAC,部署Node_exporter DaemonSet,安装Grafana可视化组件;3)配置验证,通过NodePort访问Prometheus(9090端口)和Grafana(3000端口);

2301_80348933的博客 1217

SuperPoint+SuperGlue在HLoc中的实战效果对比:5大公开数据集测试报告

本文在HLoc框架下,对传统SIFT与深度学习组合SuperPoint+SuperGlue在五大公开数据集上的视觉定位效果进行了实战对比测试。报告详细分析了两种方案在Aachen Day-Night、RobotCar Seasons等不同光照、季节及场景下的表现,揭示了SuperPoint+SuperGlue在应对剧烈光照变化和长期外观变化时的显著优势,并提供了基于HLoc模块化设计的选型与配置策略。

weixin_29093169的博客 425

Kubernetes运维之使用Prometheus全方位监控K8S

目录: Prometheus架构 K8S监控指标及实现思路 在K8S平台部署Prometheus 基于K8S服务发现的配置解析 在K8S平台部署Grafana 监控K8S集群中Pod、Node、资源对象 使用Grafana可视化展示Prometheus监控数据 告警规则与告警通知 说在前面的话,现在监控首选的话,肯定是Prometheus+Grafana,也就是很多大型公司也都在用,像RBM,360,网易,基本都是使用这一套监控系统。 一、Prometheus 是什么? Prometheu

Vic的博客 2万+

嵌入式存储实战:FAL+SFUD+flashDB三件套在STM32上的完整移植指南(附避坑技巧)

本文提供了一套在STM32上完整移植FAL、SFUD与flashDB嵌入式存储框架的实战指南。详细解析了从SPI驱动配置、SFUD设备识别、FAL抽象层分区到flashDB键值数据库初始化的全流程,并分享了关键的避坑技巧与性能优化建议,帮助开发者构建稳定可靠的嵌入式存储系统。

rnn9storyteller的博客 1017

k8s监控方案实践(三):部署与配置Grafana可视化平台

Grafana 是一个开源的可视化监控平台,能够与 Prometheus、InfluxDB、Loki 等多种数据源集成,通过丰富的图表和仪表盘展示监控数据,帮助用户实时掌握系统状态和趋势。多数据源支持:支持 Prometheus、Elasticsearch、Loki、MySQL 等众多数据源丰富的图表展示能力:支持折线图、柱状图、饼图、热力图等灵活的仪表盘配置:支持变量、查询模板、权限控制强大的社区生态:拥有大量社区共享的仪表盘模板告警功能。

沉淀自己 3462

探索robotics-toolbox-python:从基础安装到高级机器人运动学应用

本文详细介绍了robotics-toolbox-python工具箱,从基础安装、环境配置到机器人运动学与动力学的核心应用。通过D-H参数、URDF导入和内置模型三种方式快速构建机器人模型,并演示了正逆运动学计算、关节空间与任务空间轨迹规划以及三维可视化仿真。该工具箱极大地简化了机器人算法开发流程,是进行机器人学研究和应用实践的强大工具。

i1j2k的博客 496

实战封神!YOLOv7 轻量化部署全攻略:ONNX格式转换+TensorRT极致加速(速度直接提升3-5倍,精度无损)

部署核心链路,这是YOLO系列部署的最优解,速度提升3~5倍,精度无损;ONNX是桥梁:解决模型兼容性问题,简化后能去掉冗余节点,是TensorRT加速的前提;TensorRT是核心:NVIDIA显卡的极致加速引擎,FP16量化是速度与精度的最优平衡,无需手动配置,一键开启;轻量化终极组合YOLOv7-tiny + 416尺寸 + TensorRT FP16,速度提升5~8倍,满足所有实时检测场景;避坑核心:转换参数必加,推理尺寸必须一致,engine文件显卡专属。

专注于Python爬虫开发,分享爬虫技巧、项目实战与反爬经验,使用Scrapy、BeautifulSoup等工具,解决数据抓取难题。 308

Prometheus+Grafana 监控 Kubernetes

Prometheus+Grafana 监控 Kubernetes

qq_44930876的博客 2462

今日指数项目之实时流数据采集【六】

实时数据采集代码

Maynor的博客 2147

Prometheus监控实战之Prometheus监控K8S

Prometheus监控K8S

sre救赎之路 1万+

Linux 配置 multipath 多路径

每天一个 DBA 小知识,助你更进一步!

LuciferLiu_DBA 3299

Android 13.0 framework层系统手势增加上滑手势home事件功能(相当于Home键)

在13.0的定制化开发系统手势功能的时候,客户需求要求在上滑手势的时候,在底部上滑时候进入系统桌面,也就是增加 home键功能,所以就需要分析相关的系统手势上滑事件,然后添加home事件这样 就可以实现这个功能了

安卓兼职framework和app工程师的博客 1133

Prometheus监控K8S

Prometheus监控K8S,此文章附带yam文件

礁之的博客 1万+

飞牛fnNAS搭建个人小账本

本文介绍了如何在飞牛NAS上部署ezBookkeeping个人记账应用。该开源工具支持多平台使用,具备双因素认证、多级分类等功能。文章详细讲解了Docker激活、镜像下载、容器部署等步骤,并展示了账户管理、交易记录等基础操作。同时指导用户通过ZeroTier实现远程访问,方便随时随地使用个人记账系统。该方案既保障了数据隐私,又提供了专业记账功能,适合对财务隐私敏感的用户。

dgnankai的专栏 783

在k8s中部署Prometheus并实现对k8s集群的监控

本文详细介绍了如何在Kubernetes(k8s)集群中部署Prometheus,并实现对整个集群的监控。首先,文章简要概述了Prometheus作为一款开源系统监控和警报工具包的强大功能,以及它在现代云原生架构中的重要性。接着,文章详细阐述了在k8s集群中部署Prometheus的步骤,包括安装必要的组件

博客虽小,世界尽在其中 1万+

温度PID控制PLC程序

温度PID稳定控制程序,适用于欧姆龙PLC,对其他PLC也具有很大参考价值

jdk-8u144-linux-x64.tar.gz.

该资源为搭建Linux系统Java环境用,资源的后缀为tar.gz格式的压缩包

kubernetes+prometheus+grafana监控+alertmanager实现qq邮箱报警

node_exporter可以采集机器(物理机、虚拟机、云主机等)的监控指标数据,能够采集到的指标包括CPU、内存、磁盘、网络、文件数等信息Grafana是一个跨平台的开源的度量分析和可视化工具,可以将采集的数据可视化的展示,并及时通知给告警接收方。它主要有以下六大特点:1、展示方式:快速灵活的客户端图表,面板插件有许多不同方式的可视化指标和日志,官方库中具有丰富的仪表盘插件,比如热图、折线图、图表等多种展示方式;

嗨 你又来啦 2822

RU DOS版、EFI版32bit/64bit BIOS常用工具

DOS版、EFI版的RU工具,可用来查看IO、MEM、PCI、SMBIOS等资源。亲测在EFI SHELL下可用。

【云原生】Prometheus+Grafana 监控 k8s 资源实战操作

Prometheus是一个开源的系统监控和报警系统,现在已经加入到CNCF基金会,成为继k8s之后第二个在CNCF托管的项目,在kubernetes容器管理系统中,通常会搭配prometheus进行监控,同时也支持多种exporter采集数据,还支持pushgateway进行数据上报,Prometheus性能足够支撑上万台规模的集群。

匠人精神,持之以恒! 1万+
上一篇: K8s: Prometheus 监控主机 和 K8s 集群
下一篇: K8s: Prometheus结合Grafana监控应用数据及相关配置 (二)
Wang's Blog
博客等级 码龄12年 7433粉丝 2421原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Wang's Blog

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值