Загрузка данных


dmitriev-aal@VDI-Dmitriev-A:~/Desktop/appfarm/infra/k8s/nexus$ jq '
> .. | objects
> | select(.title? == "CPU Usage" or .title? == "HTTP Status Codes Dynamics")
> ' deploy/files/dashboards/nexus-dashboard.json
{
  "datasource": {
    "type": "prometheus",
    "uid": "$datasource"
  },
  "description": "Pods CPU usage",
  "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"
          }
        ]
      },
      "unit": "short"
    },
    "overrides": []
  },
  "gridPos": {
    "h": 18,
    "w": 11,
    "x": 13,
    "y": 49
  },
  "id": 4,
  "options": {
    "legend": {
      "calcs": [
        "lastNotNull",
        "max"
      ],
      "displayMode": "table",
      "placement": "bottom",
      "showLegend": true
    },
    "tooltip": {
      "mode": "multi",
      "sort": "none"
    }
  },
  "pluginVersion": "9.3.0",
  "targets": [
    {
      "datasource": {
        "uid": "$datasource"
      },
      "editorMode": "code",
      "expr": "kube_pod_container_resource_limits{pod=~\"$pod\", namespace=\"nexus\", resource=\"cpu\"}",
      "format": "time_series",
      "instant": false,
      "interval": "",
      "intervalFactor": 2,
      "legendFormat": "Limits",
      "refId": "B"
    },
    {
      "datasource": {
        "uid": "$datasource"
      },
      "editorMode": "code",
      "expr": "kube_pod_container_resource_requests{pod=~\"$pod\", namespace=\"nexus\", resource=\"cpu\", container=\"nexus3\"}",
      "hide": true,
      "interval": "",
      "intervalFactor": 2,
      "legendFormat": "Requests",
      "range": true,
      "refId": "C"
    },
    {
      "datasource": {
        "uid": "$datasource"
      },
      "editorMode": "code",
      "expr": "sum(node_namespace_pod_container:container_cpu_usage_seconds_total:sum_irate{pod=~\"$pod\", namespace=\"nexus\", container=\"nexus3\"})",
      "interval": "",
      "intervalFactor": 2,
      "legendFormat": "Usage: {{pod}}",
      "range": true,
      "refId": "A"
    }
  ],
  "title": "CPU Usage",
  "type": "timeseries"
}
{
  "datasource": {
    "type": "prometheus",
    "uid": "$datasource"
  },
  "description": "",
  "fieldConfig": {
    "defaults": {
      "color": {
        "mode": "palette-classic"
      },
      "custom": {
        "axisCenteredZero": false,
        "axisColorMode": "text",
        "axisLabel": "",
        "axisPlacement": "auto",
        "barAlignment": 0,
        "drawStyle": "bars",
        "fillOpacity": 100,
        "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"
          }
        ]
      },
      "unit": "short"
    },
    "overrides": []
  },
  "gridPos": {
    "h": 8,
    "w": 19,
    "x": 5,
    "y": 94
  },
  "id": 14,
  "options": {
    "legend": {
      "calcs": [],
      "displayMode": "list",
      "placement": "bottom",
      "showLegend": true
    },
    "tooltip": {
      "mode": "multi",
      "sort": "none"
    }
  },
  "pluginVersion": "9.3.0",
  "targets": [
    {
      "datasource": {
        "uid": "$datasource"
      },
      "editorMode": "code",
      "expr": "sum(rate(org_eclipse_jetty_webapp_WebAppContext_2xx_responses_total{namespace=\"nexus\"}[10m]))",
      "interval": "",
      "legendFormat": "2xx",
      "range": true,
      "refId": "B"
    },
    {
      "datasource": {
        "uid": "$datasource"
      },
      "expr": "sum(rate(org_eclipse_jetty_webapp_WebAppContext_4xx_responses_total{namespace=\"nexus\"}[10m]))",
      "interval": "",
      "legendFormat": "4xx",
      "refId": "A"
    },
    {
      "datasource": {
        "uid": "$datasource"
      },
      "expr": "sum(rate(org_eclipse_jetty_webapp_WebAppContext_5xx_responses_total{namespace=\"nexus\"}[10m]))",
      "interval": "",
      "legendFormat": "5xx",
      "refId": "C"
    }
  ],
  "title": "HTTP Status Codes Dynamics",
  "type": "timeseries"
}