Prometheus对java服务自定义指标的监控

prometheus微服务接入方案

检查项⽬依赖包中是否已包含actuator依赖

implementation("org.springframework.boot:spring-boot-starter-actuator")
implementation("io.micrometer:micrometer-registry-prometheus")

调整配置

增加actuator访问权限

demo:
 cloud:
   security:
     anonUris: /actuator/****

开放端点配置

management:
 #指定端⼝
  server:
    port: 19080
 #开放指标
  metrics:
 #指标配置
    export:
      prometheus:
        enabled: true
        step: 1m
        descriptions: true
    tags:
      application: ${spring.application.name}
    web:
      server:
        request:
        autotime:
          enabled: true
 #开启端点 
   endpoint:
 #开启健康监控
     health:
	  probes:
        enabled: true
 #开启数据采集
    prometheus:
      enabled: true
  health:
 #开启服务存活监控
    livenessstate:
      enabled: true
 #开启服务就绪监控 
    readinessstate:
      enabled: true
 #开放端点 
  endpoints:
    web:
      exposure:
 #指定开放端点
        include: "health,metrics,prometheus"

Deployment文件配置

增加prometheus指标采集

spec:
  replicas: 1
  selector:
    matchLabels:
      app: demo
  template:
    metadata:
      creationTimestamp: null
      labels:
        app: demo
        k8s: release
        name: demo
        version: v1
      annotations:
        metrics.alpha.kubernetes.io/custom-endpoints: '[{"api":"","path":"","port":"","names":""}]'
        prometheus.io/path: /actuator/prometheus
        prometheus.io/port: '19080'
        prometheus.io/scrape: 'true'

创建podmonitor

apiVersion: monitoring.coreos.com/v1
kind: PodMonitor
metadata:
  name: demo
  labels:
    pod-monitor: demo
  namespace: default
spec:
  namespaceSelector:
    matchNames:
    - default
  selector:
    matchLabels:
      app: demo
  podMetricsEndpoints:
  - targetPort: 19080
    path: /actuator/prometheus

添加grafana Dashboard

template.json

{
  "annotations": {
    "list": [
      {
        "builtIn": 1,
        "datasource": {
          "type": "datasource",
          "uid": "grafana"
        },
        "enable": true,
        "hide": true,
        "iconColor": "rgba(0, 211, 255, 1)",
        "name": "Annotations & Alerts",
        "target": {
          "limit": 100,
          "matchAny": false,
          "tags": [],
          "type": "dashboard"
        },
        "type": "dashboard"
      }
    ]
  },
  "description": "Dashboard for Spring Boot2.1 Statistics(based on Spring Boot2 Statistic by micrometer-prometheus).",
  "editable": true,
  "fiscalYearStartMonth": 0,
  "gnetId": 10280,
  "graphTooltip": 0,
  "id": 5,
  "links": [],
  "liveNow": false,
  "panels": [
    {
      "collapsed": false,
      "gridPos": {
        "h": 1,
        "w": 24,
        "x": 0,
        "y": 0
      },
      "id": 102,
      "panels": [],
      "title": "服务相关监控",
      "type": "row"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "b96d2b25-a112-4bac-b48e-de91410c4ecf"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "custom": {
            "align": "auto",
            "cellOptions": {
              "type": "auto"
            },
            "filterable": false,
            "inspect": false
          },
          "mappings": [],
          "thresholds": {
            "mode": "percentage",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          },
          "unitScale": true
        },
        "overrides": [
          {
            "matcher": {
              "id": "byName",
              "options": "CPU使用率"
            },
            "properties": [
              {
                "id": "unit",
                "value": "percent"
              },
              {
                "id": "custom.align",
                "value": "left"
              },
              {
                "id": "custom.cellOptions",
                "value": {
                  "mode": "lcd",
                  "type": "gauge"
                }
              },
              {
                "id": "custom.width",
                "value": 173
              },
              {
                "id": "max",
                "value": 100
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "内存限制(最小)"
            },
            "properties": [
              {
                "id": "unit",
                "value": "bytes"
              },
              {
                "id": "custom.align",
                "value": "left"
              },
              {
                "id": "custom.inspect",
                "value": false
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "内存限制(最大)"
            },
            "properties": [
              {
                "id": "unit",
                "value": "bytes"
              },
              {
                "id": "custom.align",
                "value": "left"
              },
              {
                "id": "custom.width",
                "value": 115
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "使用核数"
            },
            "properties": [
              {
                "id": "custom.cellOptions",
                "value": {
                  "mode": "gradient",
                  "type": "gauge"
                }
              },
              {
                "id": "custom.align",
                "value": "left"
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "CPU核数限制(最小)"
            },
            "properties": [
              {
                "id": "custom.align",
                "value": "left"
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "CPU核数限制(最大)"
            },
            "properties": [
              {
                "id": "custom.align",
                "value": "left"
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "内存使用率"
            },
            "properties": [
              {
                "id": "custom.cellOptions",
                "value": {
                  "mode": "lcd",
                  "type": "gauge"
                }
              },
              {
                "id": "unit",
                "value": "percent"
              },
              {
                "id": "custom.align",
                "value": "left"
              },
              {
                "id": "max",
                "value": 100
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "状态"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 81
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "应用"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 145
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "容器名称"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 258
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 7,
        "w": 24,
        "x": 0,
        "y": 1
      },
      "id": 108,
      "options": {
        "cellHeight": "sm",
        "footer": {
          "countRows": false,
          "fields": [
            "Value"
          ],
          "reducer": [
            "sum"
          ],
          "show": false
        },
        "frameIndex": 3,
        "showHeader": true,
        "sortBy": [
          {
            "desc": true,
            "displayName": "内存使用率"
          }
        ]
      },
      "pluginVersion": "10.3.3",
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "9WZvfR9Vz"
          },
          "editorMode": "code",
          "exemplar": false,
          "expr": "kube_pod_status_phase{pod=~\"$app-(.*)\",namespace=~\"default\"} == 1",
          "format": "table",
          "hide": false,
          "instant": true,
          "interval": "",
          "legendFormat": "__auto",
          "range": false,
          "refId": "A"
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "9WZvfR9Vz"
          },
          "editorMode": "code",
          "exemplar": false,
          "expr": "sum(irate(container_cpu_usage_seconds_total{pod=~\"$app-(.*)\",namespace=\"default\",container!=\"consul\"}[2m])) by (pod) / (sum(container_spec_cpu_quota{pod=~\"$app-(.*)\",namespace=\"default\",container!=\"consul\"}/100000) by (pod)) * 100",
          "format": "table",
          "hide": false,
          "instant": true,
          "legendFormat": "__auto",
          "range": false,
          "refId": "B"
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "9WZvfR9Vz"
          },
          "editorMode": "code",
          "exemplar": false,
          "expr": "sum(irate(container_cpu_usage_seconds_total{pod=~\"$app-(.*)\",namespace=\"default\",container!=\"consul\"}[2m])) by (pod)",
          "format": "table",
          "hide": false,
          "instant": true,
          "legendFormat": "CPU核数使用",
          "range": false,
          "refId": "C"
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "9WZvfR9Vz"
          },
          "editorMode": "code",
          "exemplar": false,
          "expr": "sum(kube_pod_container_resource_requests{pod=~\"$app-(.*)\",namespace=\"default\",container!=\"consul\",resource=\"cpu\"}) by (pod)",
          "format": "table",
          "hide": false,
          "instant": true,
          "legendFormat": "__auto",
          "range": false,
          "refId": "D"
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "9WZvfR9Vz"
          },
          "editorMode": "code",
          "exemplar": false,
          "expr": "sum(kube_pod_container_resource_limits{pod=~\"$app-(.*)\",namespace=\"default\",container!=\"consul\",resource=\"cpu\"}) by (pod)",
          "format": "table",
          "hide": false,
          "instant": true,
          "interval": "",
          "legendFormat": "__auto",
          "range": false,
          "refId": "L"
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "9WZvfR9Vz"
          },
          "editorMode": "code",
          "exemplar": false,
          "expr": "sum(kube_pod_container_resource_requests{pod=~\"$app-(.*)\",namespace=\"default\",container!=\"consul\",resource=\"memory\"}) by (pod)",
          "format": "table",
          "hide": false,
          "instant": true,
          "legendFormat": "__auto",
          "range": false,
          "refId": "I"
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "9WZvfR9Vz"
          },
          "editorMode": "code",
          "exemplar": false,
          "expr": "sum(kube_pod_container_resource_limits{pod=~\"$app-(.*)\",namespace=\"default\",container!=\"consul\",resource=\"memory\"}) by (pod)",
          "format": "table",
          "hide": false,
          "instant": true,
          "legendFormat": "__auto",
          "range": false,
          "refId": "J"
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "9WZvfR9Vz"
          },
          "editorMode": "code",
          "exemplar": false,
          "expr": "kube_pod_container_status_restarts_total{pod=~\"$app-(.*)\",namespace=\"default\",container=~\"$app\"} - 0",
          "format": "table",
          "hide": false,
          "instant": true,
          "legendFormat": "__auto",
          "range": false,
          "refId": "K"
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "9WZvfR9Vz"
          },
          "editorMode": "code",
          "exemplar": false,
          "expr": "(sum(container_memory_working_set_bytes{namespace=\"default\", pod=~\"$app-(.*)\", container!=\"\",container!=\"POD\", image!=\"\"})by (pod)/sum(kube_pod_container_resource_limits{namespace=\"default\",pod=~\"$app-(.*)\", resource=\"memory\"})by (pod)) * 100",
          "format": "table",
          "hide": false,
          "instant": true,
          "legendFormat": "{{内存使用率}}",
          "range": false,
          "refId": "E"
        }
      ],
      "title": "容器列表",
      "transformations": [
        {
          "id": "merge",
          "options": {}
        },
        {
          "id": "filterFieldsByName",
          "options": {
            "include": {
              "names": [
                "phase",
                "pod",
                "Value #B",
                "Value #C",
                "Value #D",
                "Value #L",
                "Value #E",
                "Value #F",
                "Value #G",
                "Value #H",
                "Value #I",
                "Value #J",
                "container",
                "Value #K"
              ]
            }
          }
        },
        {
          "id": "organize",
          "options": {
            "excludeByName": {},
            "indexByName": {
              "Value #B": 3,
              "Value #C": 4,
              "Value #D": 5,
              "Value #E": 7,
              "Value #I": 8,
              "Value #J": 9,
              "Value #K": 10,
              "Value #L": 6,
              "container": 0,
              "phase": 1,
              "pod": 2
            },
            "renameByName": {
              "Time": "",
              "Value #B": "CPU使用率",
              "Value #C": "使用核数",
              "Value #D": "CPU核数限制(最小)",
              "Value #E": "内存使用率",
              "Value #I": "内存限制(最小)",
              "Value #J": "内存限制(最大)",
              "Value #K": "容器重启次数",
              "Value #L": "CPU核数限制(最大)",
              "container": "应用",
              "phase": "状态",
              "pod": "容器名称"
            }
          }
        }
      ],
      "type": "table"
    },
    {
      "datasource": {},
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "continuous-GrYlRd",
            "seriesBy": "last"
          },
          "custom": {
            "axisBorderShow": false,
            "axisCenteredZero": false,
            "axisColorMode": "text",
            "axisLabel": "",
            "axisPlacement": "auto",
            "barAlignment": 0,
            "drawStyle": "line",
            "fillOpacity": 20,
            "gradientMode": "opacity",
            "hideFrom": {
              "legend": false,
              "tooltip": false,
              "viz": false
            },
            "insertNulls": false,
            "lineInterpolation": "smooth",
            "lineStyle": {
              "fill": "solid"
            },
            "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": "percent",
          "unitScale": true
        },
        "overrides": []
      },
      "gridPos": {
        "h": 8,
        "w": 12,
        "x": 0,
        "y": 8
      },
      "id": 118,
      "options": {
        "legend": {
          "calcs": [
            "min",
            "max",
            "last"
          ],
          "displayMode": "table",
          "placement": "bottom",
          "showLegend": true
        },
        "tooltip": {
          "mode": "single",
          "sort": "none"
        }
      },
      "pluginVersion": "9.0.0",
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "9WZvfR9Vz"
          },
          "editorMode": "code",
          "exemplar": true,
          "expr": "(sum(container_memory_working_set_bytes{namespace=\"default\", pod=~\"$app-(.*)\", container!=\"\",container!=\"POD\", image!=\"\"})by (pod)/sum(kube_pod_container_resource_limits{namespace=\"default\",pod=~\"$app-(.*)\", resource=\"memory\"})by (pod)) * 100",
          "instant": false,
          "legendFormat": "{{pod}}",
          "range": true,
          "refId": "A"
        }
      ],
      "title": "内存使用率",
      "type": "timeseries"
    },
    {
      "datasource": {},
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "continuous-GrYlRd",
            "seriesBy": "last"
          },
          "custom": {
            "axisBorderShow": false,
            "axisCenteredZero": false,
            "axisColorMode": "text",
            "axisLabel": "",
            "axisPlacement": "auto",
            "barAlignment": 0,
            "drawStyle": "line",
            "fillOpacity": 17,
            "gradientMode": "none",
            "hideFrom": {
              "legend": false,
              "tooltip": false,
              "viz": false
            },
            "insertNulls": false,
            "lineInterpolation": "smooth",
            "lineStyle": {
              "fill": "solid"
            },
            "lineWidth": 2,
            "pointSize": 5,
            "scaleDistribution": {
              "type": "linear"
            },
            "showPoints": "never",
            "spanNulls": true,
            "stacking": {
              "group": "A",
              "mode": "none"
            },
            "thresholdsStyle": {
              "mode": "off"
            }
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          },
          "unit": "percent",
          "unitScale": true
        },
        "overrides": [
          {
            "matcher": {
              "id": "byName",
              "options": "Value"
            },
            "properties": [
              {
                "id": "custom.hideFrom",
                "value": {
                  "legend": false,
                  "tooltip": false,
                  "viz": false
                }
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 8,
        "w": 12,
        "x": 12,
        "y": 8
      },
      "id": 119,
      "options": {
        "legend": {
          "calcs": [
            "min",
            "max",
            "last"
          ],
          "displayMode": "table",
          "placement": "bottom",
          "showLegend": true
        },
        "tooltip": {
          "mode": "single",
          "sort": "none"
        }
      },
      "pluginVersion": "9.0.0",
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "9WZvfR9Vz"
          },
          "editorMode": "code",
          "expr": "sum(irate(container_cpu_usage_seconds_total{pod=~\"$app-(.*)\",namespace=\"default\",container!=\"consul\"}[2m])) by (pod) / (sum(container_spec_cpu_quota{pod=~\"$app-(.*)\",namespace=\"default\",container!=\"consul\"}/100000) by (pod)) * 100",
          "legendFormat": "{{label_name}}",
          "range": true,
          "refId": "A"
        }
      ],
      "title": "CPU使用率",
      "type": "timeseries"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "b96d2b25-a112-4bac-b48e-de91410c4ecf"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "custom": {
            "align": "auto",
            "cellOptions": {
              "type": "auto"
            },
            "filterable": true,
            "inspect": false
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          },
          "unitScale": true
        },
        "overrides": [
          {
            "matcher": {
              "id": "byName",
              "options": "uri"
            },
            "properties": [
              {
                "id": "custom.align",
                "value": "left"
              },
              {
                "id": "displayName",
                "value": "请求地址"
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "uri_var"
            },
            "properties": [
              {
                "id": "custom.hidden",
                "value": true
              },
              {
                "id": "custom.filterable",
                "value": false
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "Value #A"
            },
            "properties": [
              {
                "id": "unit",
                "value": "ops"
              },
              {
                "id": "custom.align",
                "value": "left"
              },
              {
                "id": "displayName",
                "value": "访问QPS"
              },
              {
                "id": "custom.filterable",
                "value": false
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "Value #C"
            },
            "properties": [
              {
                "id": "custom.cellOptions",
                "value": {
                  "mode": "gradient",
                  "type": "color-background"
                }
              },
              {
                "id": "custom.align",
                "value": "left"
              },
              {
                "id": "unit",
                "value": "s"
              },
              {
                "id": "displayName",
                "value": "平均响应时间"
              },
              {
                "id": "custom.filterable"
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "Value #D"
            },
            "properties": [
              {
                "id": "displayName",
                "value": "接口可用性"
              },
              {
                "id": "custom.align",
                "value": "auto"
              },
              {
                "id": "unit",
                "value": "percent"
              },
              {
                "id": "custom.filterable",
                "value": false
              },
              {
                "id": "custom.cellOptions",
                "value": {
                  "mode": "gradient",
                  "type": "color-background"
                }
              },
              {
                "id": "custom.align",
                "value": "auto"
              },
              {
                "id": "thresholds",
                "value": {
                  "mode": "absolute",
                  "steps": [
                    {
                      "color": "transparent",
                      "value": null
                    },
                    {
                      "color": "red",
                      "value": 0.001
                    },
                    {
                      "color": "green",
                      "value": 1
                    }
                  ]
                }
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "请求地址"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 181
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 11,
        "w": 12,
        "x": 0,
        "y": 16
      },
      "id": 104,
      "options": {
        "cellHeight": "sm",
        "footer": {
          "countRows": false,
          "enablePagination": true,
          "fields": "",
          "reducer": [
            "sum"
          ],
          "show": false
        },
        "frameIndex": 0,
        "showHeader": true,
        "sortBy": [
          {
            "desc": true,
            "displayName": "接口可用性"
          }
        ]
      },
      "pluginVersion": "10.3.3",
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "9WZvfR9Vz"
          },
          "editorMode": "code",
          "exemplar": false,
          "expr": "label_join(sum(rate(http_server_requests_seconds_count{application=\"$application\"}[2m])) by (uri), \"uri_var\", \".\", \"uri\")",
          "format": "table",
          "hide": false,
          "instant": true,
          "legendFormat": "{{uri}}",
          "range": false,
          "refId": "A"
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "9WZvfR9Vz"
          },
          "editorMode": "code",
          "exemplar": false,
          "expr": "label_join(sum by (uri)(rate(http_server_requests_seconds_sum{application=\"$application\",  status!~\"5..\"}[2m]))/sum by (uri)(rate(http_server_requests_seconds_count{application=\"$application\", status!~\"5..\"}[2m])), \"uri_var\", \".\", \"uri\")",
          "format": "table",
          "hide": false,
          "instant": true,
          "legendFormat": "{{uri}}",
          "range": false,
          "refId": "C"
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "9WZvfR9Vz"
          },
          "editorMode": "code",
          "exemplar": false,
          "expr": "label_join(sum(rate(http_server_requests_seconds_count{application=\"$application\",status=~\"1..|2..|3..|4..\"}[2m])) by (uri) / sum(rate(http_server_requests_seconds_count{application=\"$application\"}[2m])) by (uri) , \"uri_var\", \".\", \"uri\") *100",
          "format": "table",
          "hide": false,
          "instant": true,
          "legendFormat": "__auto",
          "range": false,
          "refId": "D"
        }
      ],
      "title": "接口指标汇总",
      "transformations": [
        {
          "id": "merge",
          "options": {}
        },
        {
          "id": "filterFieldsByName",
          "options": {
            "include": {}
          }
        },
        {
          "id": "filterFieldsByName",
          "options": {}
        }
      ],
      "type": "table"
    },
    {
      "datasource": {},
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "axisBorderShow": false,
            "axisCenteredZero": false,
            "axisColorMode": "text",
            "axisLabel": "",
            "axisPlacement": "auto",
            "barAlignment": 0,
            "drawStyle": "line",
            "fillOpacity": 7,
            "gradientMode": "none",
            "hideFrom": {
              "legend": false,
              "tooltip": false,
              "viz": false
            },
            "insertNulls": false,
            "lineInterpolation": "linear",
            "lineWidth": 2,
            "pointSize": 5,
            "scaleDistribution": {
              "type": "linear"
            },
            "showPoints": "auto",
            "spanNulls": false,
            "stacking": {
              "group": "A",
              "mode": "none"
            },
            "thresholdsStyle": {
              "mode": "off"
            }
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          },
          "unit": "ops",
          "unitScale": true
        },
        "overrides": []
      },
      "gridPos": {
        "h": 11,
        "w": 12,
        "x": 12,
        "y": 16
      },
      "id": 110,
      "options": {
        "legend": {
          "calcs": [],
          "displayMode": "list",
          "placement": "bottom",
          "showLegend": false
        },
        "tooltip": {
          "mode": "single",
          "sort": "none"
        }
      },
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "9WZvfR9Vz"
          },
          "editorMode": "code",
          "exemplar": false,
          "expr": "sum(irate(http_server_requests_seconds_count{application=\"$application\"}[2m]))",
          "instant": false,
          "legendFormat": "QPS",
          "range": true,
          "refId": "A"
        }
      ],
      "title": "请求数/QPS",
      "type": "timeseries"
    },
    {
      "datasource": {},
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "axisBorderShow": false,
            "axisCenteredZero": false,
            "axisColorMode": "text",
            "axisLabel": "",
            "axisPlacement": "auto",
            "barAlignment": 0,
            "drawStyle": "line",
            "fillOpacity": 7,
            "gradientMode": "none",
            "hideFrom": {
              "legend": false,
              "tooltip": false,
              "viz": false
            },
            "insertNulls": false,
            "lineInterpolation": "linear",
            "lineStyle": {
              "fill": "solid"
            },
            "lineWidth": 2,
            "pointSize": 5,
            "scaleDistribution": {
              "type": "linear"
            },
            "showPoints": "auto",
            "spanNulls": true,
            "stacking": {
              "group": "A",
              "mode": "none"
            },
            "thresholdsStyle": {
              "mode": "off"
            }
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          },
          "unit": "s",
          "unitScale": true
        },
        "overrides": []
      },
      "gridPos": {
        "h": 6,
        "w": 12,
        "x": 0,
        "y": 27
      },
      "id": 112,
      "options": {
        "legend": {
          "calcs": [],
          "displayMode": "list",
          "placement": "bottom",
          "showLegend": false
        },
        "tooltip": {
          "mode": "single",
          "sort": "none"
        }
      },
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "9WZvfR9Vz"
          },
          "editorMode": "code",
          "expr": "sum(rate(http_server_requests_seconds_sum{app=\"$app\", status!~\"5..\"}[2m]))/sum(rate(http_server_requests_seconds_count{app=\"$app\", status!~\"5..\"}[2m]))",
          "legendFormat": "RT",
          "range": true,
          "refId": "A"
        }
      ],
      "title": "响应时间",
      "type": "timeseries"
    },
    {
      "datasource": {},
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "axisBorderShow": false,
            "axisCenteredZero": false,
            "axisColorMode": "text",
            "axisLabel": "",
            "axisPlacement": "auto",
            "barAlignment": 0,
            "drawStyle": "line",
            "fillOpacity": 7,
            "gradientMode": "none",
            "hideFrom": {
              "legend": false,
              "tooltip": false,
              "viz": false
            },
            "insertNulls": false,
            "lineInterpolation": "linear",
            "lineStyle": {
              "fill": "solid"
            },
            "lineWidth": 2,
            "pointSize": 5,
            "scaleDistribution": {
              "type": "linear"
            },
            "showPoints": "auto",
            "spanNulls": false,
            "stacking": {
              "group": "A",
              "mode": "none"
            },
            "thresholdsStyle": {
              "mode": "off"
            }
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          },
          "unit": "short",
          "unitScale": true
        },
        "overrides": []
      },
      "gridPos": {
        "h": 6,
        "w": 12,
        "x": 12,
        "y": 27
      },
      "id": 116,
      "options": {
        "legend": {
          "calcs": [
            "min",
            "max",
            "sum"
          ],
          "displayMode": "table",
          "placement": "right",
          "showLegend": true
        },
        "tooltip": {
          "mode": "single",
          "sort": "desc"
        }
      },
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "9WZvfR9Vz"
          },
          "editorMode": "code",
          "exemplar": false,
          "expr": "sum(increase(http_server_requests_seconds_count{app=\"$app\",status!=\"\"}[2m])/2) by (status)",
          "instant": false,
          "legendFormat": "{{status}}",
          "range": true,
          "refId": "A"
        }
      ],
      "title": "状态码统计",
      "type": "timeseries"
    },
    {
      "datasource": {},
      "fieldConfig": {
        "defaults": {
          "color": {
            "fixedColor": "semi-dark-red",
            "mode": "fixed",
            "seriesBy": "min"
          },
          "custom": {
            "axisBorderShow": false,
            "axisCenteredZero": false,
            "axisColorMode": "text",
            "axisLabel": "",
            "axisPlacement": "auto",
            "barAlignment": 0,
            "drawStyle": "line",
            "fillOpacity": 7,
            "gradientMode": "none",
            "hideFrom": {
              "legend": false,
              "tooltip": false,
              "viz": false
            },
            "insertNulls": false,
            "lineInterpolation": "linear",
            "lineWidth": 2,
            "pointSize": 5,
            "scaleDistribution": {
              "type": "linear"
            },
            "showPoints": "auto",
            "spanNulls": false,
            "stacking": {
              "group": "A",
              "mode": "none"
            },
            "thresholdsStyle": {
              "mode": "off"
            }
          },
          "mappings": [],
          "noValue": "0",
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          },
          "unit": "ops",
          "unitScale": true
        },
        "overrides": []
      },
      "gridPos": {
        "h": 6,
        "w": 12,
        "x": 0,
        "y": 33
      },
      "id": 114,
      "options": {
        "legend": {
          "calcs": [
            "min",
            "max",
            "sum"
          ],
          "displayMode": "table",
          "placement": "right",
          "showLegend": true
        },
        "tooltip": {
          "mode": "single",
          "sort": "none"
        }
      },
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "9WZvfR9Vz"
          },
          "editorMode": "code",
          "expr": "sum(rate(http_server_requests_seconds_count{app=\"$app\", status=~\"5..\"}[2m]))",
          "legendFormat": "{{status}}",
          "range": true,
          "refId": "A"
        }
      ],
      "title": "错误数/QPS",
      "type": "timeseries"
    },
    {
      "datasource": {},
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "axisBorderShow": false,
            "axisCenteredZero": false,
            "axisColorMode": "text",
            "axisLabel": "",
            "axisPlacement": "auto",
            "barAlignment": 0,
            "drawStyle": "line",
            "fillOpacity": 13,
            "gradientMode": "none",
            "hideFrom": {
              "legend": false,
              "tooltip": false,
              "viz": false
            },
            "insertNulls": false,
            "lineInterpolation": "linear",
            "lineWidth": 2,
            "pointSize": 5,
            "scaleDistribution": {
              "type": "linear"
            },
            "showPoints": "auto",
            "spanNulls": false,
            "stacking": {
              "group": "A",
              "mode": "none"
            },
            "thresholdsStyle": {
              "mode": "off"
            }
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          },
          "unitScale": true
        },
        "overrides": []
      },
      "gridPos": {
        "h": 6,
        "w": 12,
        "x": 12,
        "y": 33
      },
      "id": 106,
      "options": {
        "legend": {
          "calcs": [],
          "displayMode": "list",
          "placement": "bottom",
          "showLegend": false
        },
        "tooltip": {
          "mode": "single",
          "sort": "none"
        }
      },
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "9WZvfR9Vz"
          },
          "editorMode": "code",
          "expr": "count(kube_pod_status_phase{pod=~\"$app-(.*)\",namespace=~\"default\"} == 1)",
          "legendFormat": "__auto",
          "range": true,
          "refId": "A"
        }
      ],
      "title": "容器数量",
      "type": "timeseries"
    },
    {
      "collapsed": false,
      "gridPos": {
        "h": 1,
        "w": 24,
        "x": 0,
        "y": 39
      },
      "id": 126,
      "panels": [],
      "title": "数据库连接池",
      "type": "row"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "b96d2b25-a112-4bac-b48e-de91410c4ecf"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "axisBorderShow": false,
            "axisCenteredZero": false,
            "axisColorMode": "text",
            "axisLabel": "",
            "axisPlacement": "auto",
            "barAlignment": 0,
            "drawStyle": "line",
            "fillOpacity": 0,
            "gradientMode": "none",
            "hideFrom": {
              "legend": false,
              "tooltip": false,
              "viz": false
            },
            "insertNulls": false,
            "lineInterpolation": "linear",
            "lineWidth": 1,
            "pointSize": 5,
            "scaleDistribution": {
              "type": "linear"
            },
            "showPoints": "auto",
            "spanNulls": false,
            "stacking": {
              "group": "A",
              "mode": "none"
            },
            "thresholdsStyle": {
              "mode": "off"
            }
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          },
          "unitScale": true
        },
        "overrides": []
      },
      "gridPos": {
        "h": 8,
        "w": 12,
        "x": 0,
        "y": 40
      },
      "id": 128,
      "options": {
        "legend": {
          "calcs": [
            "min",
            "max",
            "last"
          ],
          "displayMode": "table",
          "placement": "bottom",
          "showLegend": true
        },
        "tooltip": {
          "mode": "single",
          "sort": "none"
        }
      },
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "9WZvfR9Vz"
          },
          "editorMode": "code",
          "expr": "hikaricp_connections_max{pod=\"$pod_name\"}",
          "legendFormat": "最大连接数",
          "range": true,
          "refId": "A"
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "9WZvfR9Vz"
          },
          "editorMode": "code",
          "expr": "hikaricp_connections{pod=\"$pod_name\"}",
          "hide": false,
          "legendFormat": "当前总连接数",
          "range": true,
          "refId": "B"
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "9WZvfR9Vz"
          },
          "editorMode": "code",
          "expr": "hikaricp_connections_active{pod=\"$pod_name\"}",
          "hide": false,
          "legendFormat": "当前活跃连接数",
          "range": true,
          "refId": "C"
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "9WZvfR9Vz"
          },
          "editorMode": "code",
          "expr": "hikaricp_connections_pending{pod=\"$pod_name\"}",
          "hide": false,
          "legendFormat": "等待连接的线程数",
          "range": true,
          "refId": "D"
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "9WZvfR9Vz"
          },
          "editorMode": "code",
          "expr": "hikaricp_connections_idle{pod=\"$pod_name\"}",
          "hide": false,
          "legendFormat": "空闲连接数",
          "range": true,
          "refId": "E"
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "9WZvfR9Vz"
          },
          "editorMode": "code",
          "expr": "hikaricp_connections_timeout_total{pod=\"$pod_name\"}",
          "hide": false,
          "legendFormat": "连接超时总数",
          "range": true,
          "refId": "F"
        }
      ],
      "title": "hikaricp",
      "type": "timeseries"
    },
    {
      "datasource": {
        "type": "prometheus",
        "uid": "b96d2b25-a112-4bac-b48e-de91410c4ecf"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "axisBorderShow": false,
            "axisCenteredZero": false,
            "axisColorMode": "text",
            "axisLabel": "",
            "axisPlacement": "auto",
            "barAlignment": 0,
            "drawStyle": "line",
            "fillOpacity": 0,
            "gradientMode": "none",
            "hideFrom": {
              "legend": false,
              "tooltip": false,
              "viz": false
            },
            "insertNulls": false,
            "lineInterpolation": "linear",
            "lineWidth": 1,
            "pointSize": 5,
            "scaleDistribution": {
              "type": "linear"
            },
            "showPoints": "auto",
            "spanNulls": false,
            "stacking": {
              "group": "A",
              "mode": "none"
            },
            "thresholdsStyle": {
              "mode": "off"
            }
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          },
          "unit": "s",
          "unitScale": true
        },
        "overrides": []
      },
      "gridPos": {
        "h": 8,
        "w": 12,
        "x": 12,
        "y": 40
      },
      "id": 129,
      "options": {
        "legend": {
          "calcs": [
            "min",
            "max",
            "last"
          ],
          "displayMode": "table",
          "placement": "bottom",
          "showLegend": true
        },
        "tooltip": {
          "mode": "single",
          "sort": "none"
        }
      },
      "targets": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "9WZvfR9Vz"
          },
          "editorMode": "code",
          "expr": "hikaricp_connections_usage_seconds_max{pod=\"$pod_name\"}",
          "hide": false,
          "legendFormat": "连接最长使用时间",
          "range": true,
          "refId": "G"
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "9WZvfR9Vz"
          },
          "editorMode": "code",
          "expr": "hikaricp_connections_creation_seconds_max{pod=\"$pod_name\"}",
          "hide": false,
          "legendFormat": "创建连接最长耗时",
          "range": true,
          "refId": "H"
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "9WZvfR9Vz"
          },
          "editorMode": "code",
          "expr": "hikaricp_connections_acquire_seconds_max{pod=\"$pod_name\"}",
          "hide": false,
          "legendFormat": "获取连接最长耗时",
          "range": true,
          "refId": "I"
        }
      ],
      "title": "hikaricp",
      "type": "timeseries"
    },
    {
      "collapsed": true,
      "gridPos": {
        "h": 1,
        "w": 24,
        "x": 0,
        "y": 48
      },
      "id": 123,
      "panels": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "b96d2b25-a112-4bac-b48e-de91410c4ecf"
          },
          "fieldConfig": {
            "defaults": {
              "color": {
                "mode": "palette-classic"
              },
              "custom": {
                "axisBorderShow": false,
                "axisCenteredZero": false,
                "axisColorMode": "text",
                "axisLabel": "",
                "axisPlacement": "auto",
                "barAlignment": 0,
                "drawStyle": "line",
                "fillOpacity": 0,
                "gradientMode": "none",
                "hideFrom": {
                  "legend": false,
                  "tooltip": false,
                  "viz": false
                },
                "insertNulls": false,
                "lineInterpolation": "smooth",
                "lineWidth": 1,
                "pointSize": 5,
                "scaleDistribution": {
                  "type": "linear"
                },
                "showPoints": "auto",
                "spanNulls": false,
                "stacking": {
                  "group": "A",
                  "mode": "none"
                },
                "thresholdsStyle": {
                  "mode": "off"
                }
              },
              "mappings": [],
              "thresholds": {
                "mode": "absolute",
                "steps": [
                  {
                    "color": "green"
                  },
                  {
                    "color": "red",
                    "value": 80
                  }
                ]
              },
              "unitScale": true
            },
            "overrides": []
          },
          "gridPos": {
            "h": 8,
            "w": 12,
            "x": 0,
            "y": 41
          },
          "id": 121,
          "options": {
            "legend": {
              "calcs": [
                "min",
                "max",
                "last"
              ],
              "displayMode": "table",
              "placement": "bottom",
              "showLegend": true,
              "sortBy": "Last",
              "sortDesc": true
            },
            "tooltip": {
              "mode": "single",
              "sort": "none"
            }
          },
          "targets": [
            {
              "datasource": {
                "type": "prometheus",
                "uid": "9WZvfR9Vz"
              },
              "editorMode": "code",
              "expr": "executor_queue_remaining_tasks{pod=\"$pod_name\"}",
              "hide": false,
              "legendFormat": "total:{{name}}",
              "range": true,
              "refId": "A"
            },
            {
              "datasource": {
                "type": "prometheus",
                "uid": "9WZvfR9Vz"
              },
              "editorMode": "code",
              "expr": "executor_queued_tasks{pod=\"$pod_name\"}",
              "hide": false,
              "legendFormat": "active:{{name}}",
              "range": true,
              "refId": "B"
            },
            {
              "datasource": {
                "type": "prometheus",
                "uid": "9WZvfR9Vz"
              },
              "editorMode": "code",
              "expr": "executor_completed_tasks_total{pod=\"$pod_name\"}",
              "hide": false,
              "legendFormat": "complete:{{name}}",
              "range": true,
              "refId": "D"
            }
          ],
          "title": "线程池队列容量",
          "type": "timeseries"
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "b96d2b25-a112-4bac-b48e-de91410c4ecf"
          },
          "fieldConfig": {
            "defaults": {
              "color": {
                "mode": "palette-classic"
              },
              "custom": {
                "axisBorderShow": false,
                "axisCenteredZero": false,
                "axisColorMode": "text",
                "axisLabel": "",
                "axisPlacement": "auto",
                "barAlignment": 0,
                "drawStyle": "line",
                "fillOpacity": 0,
                "gradientMode": "none",
                "hideFrom": {
                  "legend": false,
                  "tooltip": false,
                  "viz": false
                },
                "insertNulls": false,
                "lineInterpolation": "smooth",
                "lineWidth": 1,
                "pointSize": 5,
                "scaleDistribution": {
                  "type": "linear"
                },
                "showPoints": "auto",
                "spanNulls": false,
                "stacking": {
                  "group": "A",
                  "mode": "none"
                },
                "thresholdsStyle": {
                  "mode": "off"
                }
              },
              "mappings": [],
              "thresholds": {
                "mode": "absolute",
                "steps": [
                  {
                    "color": "green"
                  },
                  {
                    "color": "red",
                    "value": 80
                  }
                ]
              },
              "unitScale": true
            },
            "overrides": []
          },
          "gridPos": {
            "h": 8,
            "w": 12,
            "x": 12,
            "y": 41
          },
          "id": 124,
          "options": {
            "legend": {
              "calcs": [
                "min",
                "max",
                "last"
              ],
              "displayMode": "table",
              "placement": "bottom",
              "showLegend": true
            },
            "tooltip": {
              "mode": "single",
              "sort": "none"
            }
          },
          "targets": [
            {
              "datasource": {
                "type": "prometheus",
                "uid": "9WZvfR9Vz"
              },
              "editorMode": "code",
              "expr": "executor_pool_core_threads{pod=\"$pod_name\"}",
              "legendFormat": "core:{{name}}",
              "range": true,
              "refId": "A"
            },
            {
              "datasource": {
                "type": "prometheus",
                "uid": "9WZvfR9Vz"
              },
              "editorMode": "code",
              "expr": "executor_pool_max_threads{pod=\"$pod_name\"}",
              "hide": false,
              "legendFormat": "Max:{{name}}",
              "range": true,
              "refId": "B"
            },
            {
              "datasource": {
                "type": "prometheus",
                "uid": "9WZvfR9Vz"
              },
              "editorMode": "code",
              "exemplar": false,
              "expr": "executor_pool_size_threads{pod=\"$pod_name\"}",
              "format": "time_series",
              "hide": false,
              "instant": false,
              "legendFormat": "Running:{{name}}",
              "range": true,
              "refId": "C"
            },
            {
              "datasource": {
                "type": "prometheus",
                "uid": "9WZvfR9Vz"
              },
              "editorMode": "code",
              "expr": "executor_active_threads{pod=\"$pod_name\"}",
              "hide": false,
              "legendFormat": "active:{{name}}",
              "range": true,
              "refId": "D"
            }
          ],
          "title": "线程池",
          "type": "timeseries"
        }
      ],
      "title": "线程池",
      "type": "row"
    },
    {
      "collapsed": true,
      "datasource": {
        "type": "prometheus",
        "uid": "9WZvfR9Vz"
      },
      "gridPos": {
        "h": 1,
        "w": 24,
        "x": 0,
        "y": 49
      },
      "id": 54,
      "panels": [
        {
          "datasource": {},
          "fieldConfig": {
            "defaults": {
              "color": {
                "mode": "thresholds"
              },
              "decimals": 1,
              "mappings": [
                {
                  "options": {
                    "match": "null",
                    "result": {
                      "text": "N/A"
                    }
                  },
                  "type": "special"
                }
              ],
              "max": 100,
              "min": 0,
              "thresholds": {
                "mode": "absolute",
                "steps": [
                  {
                    "color": "rgba(50, 172, 45, 0.97)"
                  },
                  {
                    "color": "rgba(237, 129, 40, 0.89)",
                    "value": 70
                  },
                  {
                    "color": "rgba(245, 54, 54, 0.9)",
                    "value": 90
                  }
                ]
              },
              "unit": "percent",
              "unitScale": true
            },
            "overrides": []
          },
          "gridPos": {
            "h": 8,
            "w": 4,
            "x": 0,
            "y": 42
          },
          "id": 58,
          "links": [],
          "maxDataPoints": 100,
          "options": {
            "minVizHeight": 75,
            "minVizWidth": 75,
            "orientation": "horizontal",
            "reduceOptions": {
              "calcs": [
                "lastNotNull"
              ],
              "fields": "",
              "values": false
            },
            "showThresholdLabels": false,
            "showThresholdMarkers": true,
            "sizing": "auto"
          },
          "pluginVersion": "10.3.3",
          "targets": [
            {
              "datasource": {
                "type": "prometheus",
                "uid": "9WZvfR9Vz"
              },
              "editorMode": "code",
              "expr": "sum(jvm_memory_used_bytes{application=\"$application\", instance=\"$instance\", area=\"heap\"})*100/sum(jvm_memory_max_bytes{application=\"$application\",instance=\"$instance\", area=\"heap\"})",
              "format": "time_series",
              "intervalFactor": 1,
              "legendFormat": "",
              "range": true,
              "refId": "A",
              "step": 14400
            }
          ],
          "title": "Heap Used",
          "type": "gauge"
        },
        {
          "datasource": {},
          "fieldConfig": {
            "defaults": {
              "color": {
                "mode": "thresholds"
              },
              "decimals": 1,
              "mappings": [
                {
                  "options": {
                    "match": "null",
                    "result": {
                      "text": "N/A"
                    }
                  },
                  "type": "special"
                },
                {
                  "options": {
                    "from": -1e+32,
                    "result": {
                      "text": "N/A"
                    },
                    "to": 0
                  },
                  "type": "range"
                }
              ],
              "max": 100,
              "min": 0,
              "thresholds": {
                "mode": "absolute",
                "steps": [
                  {
                    "color": "rgba(50, 172, 45, 0.97)"
                  },
                  {
                    "color": "rgba(237, 129, 40, 0.89)",
                    "value": 70
                  },
                  {
                    "color": "rgba(245, 54, 54, 0.9)",
                    "value": 90
                  }
                ]
              },
              "unit": "percent",
              "unitScale": true
            },
            "overrides": []
          },
          "gridPos": {
            "h": 8,
            "w": 4,
            "x": 4,
            "y": 42
          },
          "id": 60,
          "links": [],
          "maxDataPoints": 100,
          "options": {
            "minVizHeight": 75,
            "minVizWidth": 75,
            "orientation": "horizontal",
            "reduceOptions": {
              "calcs": [
                "lastNotNull"
              ],
              "fields": "",
              "values": false
            },
            "showThresholdLabels": false,
            "showThresholdMarkers": true,
            "sizing": "auto"
          },
          "pluginVersion": "10.3.3",
          "targets": [
            {
              "datasource": {
                "type": "prometheus",
                "uid": "b96d2b25-a112-4bac-b48e-de91410c4ecf"
              },
              "editorMode": "code",
              "expr": "sum(jvm_memory_used_bytes{application=\"$application\", instance=\"$instance\", area=\"nonheap\"})*100/sum(jvm_memory_max_bytes{application=\"$application\",instance=\"$instance\", area=\"nonheap\"})",
              "format": "time_series",
              "intervalFactor": 2,
              "legendFormat": "",
              "range": true,
              "refId": "A",
              "step": 14400
            }
          ],
          "title": "Non-Heap Used",
          "type": "gauge"
        },
        {
          "aliasColors": {},
          "bars": false,
          "dashLength": 10,
          "dashes": false,
          "datasource": {
            "type": "prometheus",
            "uid": "b96d2b25-a112-4bac-b48e-de91410c4ecf"
          },
          "fieldConfig": {
            "defaults": {
              "unitScale": true
            },
            "overrides": []
          },
          "fill": 1,
          "fillGradient": 0,
          "gridPos": {
            "h": 8,
            "w": 16,
            "x": 8,
            "y": 42
          },
          "hiddenSeries": false,
          "id": 95,
          "legend": {
            "alignAsTable": true,
            "avg": true,
            "current": true,
            "max": true,
            "min": true,
            "show": true,
            "total": false,
            "values": true
          },
          "lines": true,
          "linewidth": 1,
          "links": [],
          "nullPointMode": "null",
          "options": {
            "alertThreshold": true
          },
          "percentage": false,
          "pluginVersion": "10.3.3",
          "pointradius": 5,
          "points": false,
          "renderer": "flot",
          "seriesOverrides": [],
          "spaceLength": 10,
          "stack": false,
          "steppedLine": false,
          "targets": [
            {
              "datasource": {
                "type": "prometheus",
                "uid": "b96d2b25-a112-4bac-b48e-de91410c4ecf"
              },
              "editorMode": "code",
              "expr": "system_cpu_usage{instance=\"$instance\", application=\"$application\"}",
              "format": "time_series",
              "intervalFactor": 1,
              "legendFormat": "System CPU Usage",
              "range": true,
              "refId": "A"
            },
            {
              "datasource": {
                "type": "prometheus",
                "uid": "b96d2b25-a112-4bac-b48e-de91410c4ecf"
              },
              "editorMode": "code",
              "expr": "process_cpu_usage{instance=\"$instance\", application=\"$application\"}",
              "format": "time_series",
              "intervalFactor": 1,
              "legendFormat": "Process CPU Usage",
              "range": true,
              "refId": "B"
            }
          ],
          "thresholds": [],
          "timeRegions": [],
          "title": "CPU Usage",
          "tooltip": {
            "shared": true,
            "sort": 0,
            "value_type": "individual"
          },
          "type": "graph",
          "xaxis": {
            "mode": "time",
            "show": true,
            "values": []
          },
          "yaxes": [
            {
              "format": "short",
              "logBase": 1,
              "show": true
            },
            {
              "format": "short",
              "logBase": 1,
              "show": true
            }
          ],
          "yaxis": {
            "align": false
          }
        }
      ],
      "title": "Basic Statistics",
      "type": "row"
    },
    {
      "collapsed": true,
      "datasource": {
        "type": "prometheus",
        "uid": "9WZvfR9Vz"
      },
      "gridPos": {
        "h": 1,
        "w": 24,
        "x": 0,
        "y": 50
      },
      "id": 48,
      "panels": [
        {
          "datasource": {
            "type": "prometheus",
            "uid": "b96d2b25-a112-4bac-b48e-de91410c4ecf"
          },
          "fieldConfig": {
            "defaults": {
              "color": {
                "mode": "palette-classic"
              },
              "custom": {
                "axisBorderShow": false,
                "axisCenteredZero": false,
                "axisColorMode": "text",
                "axisLabel": "",
                "axisPlacement": "auto",
                "axisSoftMin": -1,
                "barAlignment": 0,
                "drawStyle": "line",
                "fillOpacity": 13,
                "gradientMode": "none",
                "hideFrom": {
                  "legend": false,
                  "tooltip": false,
                  "viz": false
                },
                "insertNulls": false,
                "lineInterpolation": "linear",
                "lineStyle": {
                  "fill": "solid"
                },
                "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": "decmbytes",
              "unitScale": true
            },
            "overrides": []
          },
          "gridPos": {
            "h": 13,
            "w": 12,
            "x": 0,
            "y": 51
          },
          "id": 131,
          "options": {
            "legend": {
              "calcs": [
                "min",
                "max",
                "last"
              ],
              "displayMode": "table",
              "placement": "bottom",
              "showLegend": true
            },
            "tooltip": {
              "mode": "single",
              "sort": "none"
            }
          },
          "pluginVersion": "9.0.0",
          "targets": [
            {
              "datasource": {
                "type": "prometheus",
                "uid": "9WZvfR9Vz"
              },
              "editorMode": "code",
              "expr": "jvm_memory_used_bytes{pod=\"$pod_name\",area=\"heap\"} / 1024 /1024",
              "legendFormat": "{{id}}:已用内存",
              "range": true,
              "refId": "A"
            },
            {
              "datasource": {
                "type": "prometheus",
                "uid": "9WZvfR9Vz"
              },
              "editorMode": "code",
              "expr": "jvm_memory_max_bytes{pod=\"$pod_name\",area=\"heap\"} / 1024 /1024",
              "hide": false,
              "legendFormat": "{{id}}:最大可用内存",
              "range": true,
              "refId": "B"
            },
            {
              "datasource": {
                "type": "prometheus",
                "uid": "9WZvfR9Vz"
              },
              "editorMode": "code",
              "expr": "jvm_memory_committed_bytes{pod=\"$pod_name\",area=\"heap\"} / 1024 /1024",
              "hide": true,
              "legendFormat": "{{id}}:申请内存",
              "range": true,
              "refId": "C"
            }
          ],
          "title": "堆内内存使用",
          "type": "timeseries"
        },
        {
          "datasource": {
            "type": "prometheus",
            "uid": "b96d2b25-a112-4bac-b48e-de91410c4ecf"
          },
          "fieldConfig": {
            "defaults": {
              "color": {
                "mode": "palette-classic"
              },
              "custom": {
                "axisBorderShow": false,
                "axisCenteredZero": false,
                "axisColorMode": "text",
                "axisLabel": "",
                "axisPlacement": "auto",
                "axisSoftMin": -1,
                "barAlignment": 0,
                "drawStyle": "line",
                "fillOpacity": 13,
                "gradientMode": "none",
                "hideFrom": {
                  "legend": false,
                  "tooltip": false,
                  "viz": false
                },
                "insertNulls": false,
                "lineInterpolation": "linear",
                "lineStyle": {
                  "fill": "solid"
                },
                "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": "decmbytes",
              "unitScale": true
            },
            "overrides": []
          },
          "gridPos": {
            "h": 13,
            "w": 12,
            "x": 12,
            "y": 51
          },
          "id": 133,
          "options": {
            "legend": {
              "calcs": [
                "min",
                "max",
                "last"
              ],
              "displayMode": "table",
              "placement": "bottom",
              "showLegend": true
            },
            "tooltip": {
              "mode": "single",
              "sort": "none"
            }
          },
          "pluginVersion": "9.0.0",
          "targets": [
            {
              "datasource": {
                "type": "prometheus",
                "uid": "9WZvfR9Vz"
              },
              "editorMode": "code",
              "expr": "jvm_memory_used_bytes{pod=\"$pod_name\",area=\"nonheap\"} / 1024 /1024",
              "legendFormat": "{{id}}:已用内存",
              "range": true,
              "refId": "A"
            },
            {
              "datasource": {
                "type": "prometheus",
                "uid": "9WZvfR9Vz"
              },
              "editorMode": "code",
              "expr": "jvm_memory_max_bytes{pod=\"$pod_name\",area=\"nonheap\"} / 1024 /1024",
              "hide": false,
              "legendFormat": "{{id}}:最大可用内存",
              "range": true,
              "refId": "B"
            },
            {
              "datasource": {
                "type": "prometheus",
                "uid": "9WZvfR9Vz"
              },
              "editorMode": "code",
              "expr": "jvm_memory_committed_bytes{pod=\"$pod_name\",area=\"heap\"} / 1024 /1024",
              "hide": true,
              "legendFormat": "{{id}}:申请内存",
              "range": true,
              "refId": "C"
            }
          ],
          "title": "堆外内存使用",
          "type": "timeseries"
        },
        {
          "datasource": {},
          "fieldConfig": {
            "defaults": {
              "color": {
                "mode": "palette-classic"
              },
              "custom": {
                "axisBorderShow": false,
                "axisCenteredZero": false,
                "axisColorMode": "text",
                "axisLabel": "",
                "axisPlacement": "auto",
                "axisSoftMin": -1,
                "barAlignment": 0,
                "drawStyle": "line",
                "fillOpacity": 8,
                "gradientMode": "none",
                "hideFrom": {
                  "legend": false,
                  "tooltip": false,
                  "viz": false
                },
                "insertNulls": 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": "none",
              "unitScale": true
            },
            "overrides": []
          },
          "gridPos": {
            "h": 13,
            "w": 12,
            "x": 0,
            "y": 64
          },
          "id": 132,
          "options": {
            "legend": {
              "calcs": [
                "min",
                "max",
                "last"
              ],
              "displayMode": "table",
              "placement": "bottom",
              "showLegend": true
            },
            "tooltip": {
              "mode": "single",
              "sort": "none"
            }
          },
          "pluginVersion": "9.0.0",
          "targets": [
            {
              "datasource": {
                "type": "prometheus",
                "uid": "9WZvfR9Vz"
              },
              "editorMode": "code",
              "expr": "jvm_threads_states_threads{pod=\"$pod_name\"}",
              "legendFormat": "{{state}}",
              "range": true,
              "refId": "A"
            }
          ],
          "title": "JVM线程状态",
          "type": "timeseries"
        },
        {
          "aliasColors": {},
          "bars": false,
          "dashLength": 10,
          "dashes": false,
          "datasource": {
            "type": "prometheus",
            "uid": "b96d2b25-a112-4bac-b48e-de91410c4ecf"
          },
          "fieldConfig": {
            "defaults": {
              "unitScale": true
            },
            "overrides": []
          },
          "fill": 1,
          "fillGradient": 0,
          "gridPos": {
            "h": 13,
            "w": 12,
            "x": 12,
            "y": 64
          },
          "hiddenSeries": false,
          "id": 68,
          "legend": {
            "alignAsTable": true,
            "avg": true,
            "current": true,
            "max": true,
            "min": true,
            "show": true,
            "total": false,
            "values": true
          },
          "lines": true,
          "linewidth": 1,
          "links": [],
          "nullPointMode": "null",
          "options": {
            "alertThreshold": true
          },
          "percentage": false,
          "pluginVersion": "10.3.3",
          "pointradius": 5,
          "points": false,
          "renderer": "flot",
          "seriesOverrides": [],
          "spaceLength": 10,
          "stack": false,
          "steppedLine": false,
          "targets": [
            {
              "datasource": {
                "type": "prometheus",
                "uid": "9WZvfR9Vz"
              },
              "editorMode": "code",
              "expr": "jvm_threads_daemon_threads{instance=\"$instance\", pod=\"$pod_name\"}",
              "format": "time_series",
              "intervalFactor": 1,
              "legendFormat": "Daemon",
              "range": true,
              "refId": "A"
            },
            {
              "datasource": {
                "type": "prometheus",
                "uid": "9WZvfR9Vz"
              },
              "editorMode": "code",
              "expr": "jvm_threads_live_threads{instance=\"$instance\", pod=\"$pod_name\"}",
              "format": "time_series",
              "intervalFactor": 1,
              "legendFormat": "Live",
              "range": true,
              "refId": "B"
            },
            {
              "datasource": {
                "type": "prometheus",
                "uid": "9WZvfR9Vz"
              },
              "editorMode": "code",
              "expr": "jvm_threads_peak_threads{instance=\"$instance\", pod=\"$pod_name\"}",
              "format": "time_series",
              "intervalFactor": 1,
              "legendFormat": "Peak",
              "range": true,
              "refId": "C"
            }
          ],
          "thresholds": [],
          "timeRegions": [],
          "title": "线程",
          "tooltip": {
            "shared": true,
            "sort": 0,
            "value_type": "individual"
          },
          "type": "graph",
          "xaxis": {
            "mode": "time",
            "show": true,
            "values": []
          },
          "yaxes": [
            {
              "$$hashKey": "object:164",
              "format": "short",
              "logBase": 1,
              "show": true
            },
            {
              "$$hashKey": "object:165",
              "format": "short",
              "logBase": 1,
              "show": true
            }
          ],
          "yaxis": {
            "align": false
          }
        }
      ],
      "title": "JVM",
      "type": "row"
    },
    {
      "collapsed": true,
      "datasource": {
        "type": "prometheus",
        "uid": "9WZvfR9Vz"
      },
      "gridPos": {
        "h": 1,
        "w": 24,
        "x": 0,
        "y": 51
      },
      "id": 72,
      "panels": [
        {
          "aliasColors": {},
          "bars": false,
          "dashLength": 10,
          "dashes": false,
          "datasource": {
            "type": "prometheus",
            "uid": "b96d2b25-a112-4bac-b48e-de91410c4ecf"
          },
          "fieldConfig": {
            "defaults": {
              "unitScale": true
            },
            "overrides": []
          },
          "fill": 1,
          "fillGradient": 0,
          "gridPos": {
            "h": 10,
            "w": 12,
            "x": 0,
            "y": 78
          },
          "hiddenSeries": false,
          "id": 74,
          "legend": {
            "alignAsTable": true,
            "avg": true,
            "current": false,
            "hideEmpty": true,
            "hideZero": true,
            "max": true,
            "min": true,
            "show": true,
            "total": true,
            "values": true
          },
          "lines": true,
          "linewidth": 1,
          "links": [],
          "nullPointMode": "null",
          "options": {
            "alertThreshold": true
          },
          "percentage": false,
          "pluginVersion": "10.3.3",
          "pointradius": 5,
          "points": false,
          "renderer": "flot",
          "seriesOverrides": [],
          "spaceLength": 10,
          "stack": false,
          "steppedLine": false,
          "targets": [
            {
              "datasource": {
                "type": "prometheus",
                "uid": "9WZvfR9Vz"
              },
              "editorMode": "code",
              "expr": "irate(jvm_gc_pause_seconds_count{instance=\"$instance\", pod=\"$pod_name\"}[5m])",
              "format": "time_series",
              "intervalFactor": 1,
              "legendFormat": "{{action}} [{{cause}}]",
              "range": true,
              "refId": "A"
            }
          ],
          "thresholds": [],
          "timeRegions": [],
          "title": "GC Count",
          "tooltip": {
            "shared": true,
            "sort": 0,
            "value_type": "individual"
          },
          "type": "graph",
          "xaxis": {
            "mode": "time",
            "show": true,
            "values": []
          },
          "yaxes": [
            {
              "$$hashKey": "object:218",
              "format": "locale",
              "logBase": 1,
              "show": true
            },
            {
              "$$hashKey": "object:219",
              "format": "short",
              "logBase": 1,
              "show": true
            }
          ],
          "yaxis": {
            "align": false
          }
        },
        {
          "aliasColors": {},
          "bars": false,
          "dashLength": 10,
          "dashes": false,
          "datasource": {},
          "fieldConfig": {
            "defaults": {
              "unitScale": true
            },
            "overrides": []
          },
          "fill": 1,
          "fillGradient": 0,
          "gridPos": {
            "h": 10,
            "w": 12,
            "x": 12,
            "y": 78
          },
          "hiddenSeries": false,
          "id": 76,
          "legend": {
            "alignAsTable": true,
            "avg": true,
            "current": false,
            "hideEmpty": true,
            "hideZero": true,
            "max": true,
            "min": true,
            "show": true,
            "total": true,
            "values": true
          },
          "lines": true,
          "linewidth": 1,
          "links": [],
          "nullPointMode": "null",
          "options": {
            "alertThreshold": true
          },
          "percentage": false,
          "pluginVersion": "10.3.3",
          "pointradius": 5,
          "points": false,
          "renderer": "flot",
          "seriesOverrides": [],
          "spaceLength": 10,
          "stack": false,
          "steppedLine": false,
          "targets": [
            {
              "datasource": {
                "type": "prometheus",
                "uid": "9WZvfR9Vz"
              },
              "editorMode": "code",
              "expr": "irate(jvm_gc_pause_seconds_sum{instance=\"$instance\", pod=\"$pod_name\"}[5m])",
              "format": "time_series",
              "intervalFactor": 1,
              "legendFormat": "{{action}} [{{cause}}]",
              "range": true,
              "refId": "A"
            }
          ],
          "thresholds": [],
          "timeRegions": [],
          "title": "GC Stop the World Duration",
          "tooltip": {
            "shared": true,
            "sort": 0,
            "value_type": "individual"
          },
          "type": "graph",
          "xaxis": {
            "mode": "time",
            "show": true,
            "values": []
          },
          "yaxes": [
            {
              "$$hashKey": "object:276",
              "format": "s",
              "logBase": 1,
              "show": true
            },
            {
              "$$hashKey": "object:277",
              "format": "short",
              "logBase": 1,
              "show": true
            }
          ],
          "yaxis": {
            "align": false
          }
        }
      ],
      "title": "JVM Statistics - GC",
      "type": "row"
    },
    {
      "collapsed": true,
      "datasource": {
        "type": "prometheus",
        "uid": "9WZvfR9Vz"
      },
      "gridPos": {
        "h": 1,
        "w": 24,
        "x": 0,
        "y": 52
      },
      "id": 18,
      "panels": [
        {
          "aliasColors": {},
          "bars": false,
          "dashLength": 10,
          "dashes": false,
          "datasource": {},
          "fieldConfig": {
            "defaults": {
              "unitScale": true
            },
            "overrides": []
          },
          "fill": 1,
          "fillGradient": 0,
          "gridPos": {
            "h": 7,
            "w": 24,
            "x": 0,
            "y": 89
          },
          "hiddenSeries": false,
          "id": 4,
          "legend": {
            "alignAsTable": true,
            "avg": false,
            "current": true,
            "max": true,
            "min": true,
            "rightSide": true,
            "show": true,
            "total": false,
            "values": true
          },
          "lines": true,
          "linewidth": 1,
          "links": [],
          "nullPointMode": "null",
          "options": {
            "alertThreshold": true
          },
          "percentage": false,
          "pluginVersion": "10.3.3",
          "pointradius": 5,
          "points": false,
          "renderer": "flot",
          "seriesOverrides": [],
          "spaceLength": 10,
          "stack": false,
          "steppedLine": false,
          "targets": [
            {
              "datasource": {
                "type": "prometheus",
                "uid": "9WZvfR9Vz"
              },
              "editorMode": "code",
              "expr": "irate(http_server_requests_seconds_count{instance=\"$instance\", pod=\"$pod_name\", uri!~\".*actuator.*\"}[5m])",
              "format": "time_series",
              "intervalFactor": 1,
              "legendFormat": "{{method}} [{{status}}] - {{uri}}",
              "range": true,
              "refId": "A"
            }
          ],
          "thresholds": [],
          "timeRegions": [],
          "title": "Request Count",
          "tooltip": {
            "shared": true,
            "sort": 0,
            "value_type": "individual"
          },
          "type": "graph",
          "xaxis": {
            "mode": "time",
            "show": true,
            "values": []
          },
          "yaxes": [
            {
              "$$hashKey": "object:146",
              "format": "none",
              "logBase": 1,
              "show": true
            },
            {
              "$$hashKey": "object:147",
              "format": "short",
              "logBase": 1,
              "show": true
            }
          ],
          "yaxis": {
            "align": false
          }
        },
        {
          "aliasColors": {},
          "bars": false,
          "dashLength": 10,
          "dashes": false,
          "datasource": {},
          "fieldConfig": {
            "defaults": {
              "unitScale": true
            },
            "overrides": []
          },
          "fill": 1,
          "fillGradient": 0,
          "gridPos": {
            "h": 7,
            "w": 24,
            "x": 0,
            "y": 96
          },
          "hiddenSeries": false,
          "id": 2,
          "legend": {
            "alignAsTable": true,
            "avg": true,
            "current": false,
            "max": true,
            "min": true,
            "rightSide": true,
            "show": true,
            "total": false,
            "values": true
          },
          "lines": true,
          "linewidth": 1,
          "links": [],
          "nullPointMode": "null",
          "options": {
            "alertThreshold": true
          },
          "percentage": false,
          "pluginVersion": "10.3.3",
          "pointradius": 5,
          "points": false,
          "renderer": "flot",
          "seriesOverrides": [],
          "spaceLength": 10,
          "stack": false,
          "steppedLine": false,
          "targets": [
            {
              "datasource": {
                "type": "prometheus",
                "uid": "9WZvfR9Vz"
              },
              "editorMode": "code",
              "expr": "irate(http_server_requests_seconds_sum{instance=\"$instance\", pod=\"$pod_name\", exception=\"None\", uri!~\".*actuator.*\"}[5m]) / irate(http_server_requests_seconds_count{instance=\"$instance\", pod=\"$pod_name\", exception=\"None\", uri!~\".*actuator.*\"}[5m])",
              "format": "time_series",
              "intervalFactor": 1,
              "legendFormat": "{{method}} [{{status}}] - {{uri}}",
              "range": true,
              "refId": "A"
            }
          ],
          "thresholds": [],
          "timeRegions": [],
          "title": "Response Time",
          "tooltip": {
            "shared": true,
            "sort": 0,
            "value_type": "individual"
          },
          "type": "graph",
          "xaxis": {
            "mode": "time",
            "show": true,
            "values": []
          },
          "yaxes": [
            {
              "$$hashKey": "object:384",
              "format": "s",
              "label": "",
              "logBase": 1,
              "show": true
            },
            {
              "$$hashKey": "object:385",
              "format": "short",
              "logBase": 1,
              "show": true
            }
          ],
          "yaxis": {
            "align": false
          }
        }
      ],
      "title": "HTTP Statistics",
      "type": "row"
    }
  ],
  "refresh": "",
  "schemaVersion": 39,
  "tags": [
    "prometheus"
  ],
  "templating": {
    "list": [
      {
        "current": {
          "selected": false,
          "text": "k8s-prod-custom-metrics",
          "value": "k8s-prod-custom-metrics"
        },
        "hide": 2,
        "includeAll": false,
        "label": "环境",
        "multi": false,
        "name": "cloud_env",
        "options": [
          {
            "selected": true,
            "text": "k8s-prod-custom-metrics",
            "value": "k8s-prod-custom-metrics"
          }
        ],
        "query": "k8s-prod-custom-metrics",
        "queryValue": "",
        "skipUrlSync": false,
        "type": "custom"
      },
      {
        "current": {
          "selected": true,
          "text": "analysis-screen",
          "value": "analysis-screen"
        },
        "datasource": {
          "type": "prometheus",
          "uid": "b96d2b25-a112-4bac-b48e-de91410c4ecf"
        },
        "definition": "label_values({job=\"$cloud_env\"},application)",
        "hide": 0,
        "includeAll": false,
        "label": "服务名称",
        "multi": false,
        "name": "application",
        "options": [],
        "query": {
          "query": "label_values({job=\"$cloud_env\"},application)",
          "refId": "StandardVariableQuery"
        },
        "refresh": 1,
        "regex": "",
        "skipUrlSync": false,
        "sort": 1,
        "tagValuesQuery": "",
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      },
      {
        "current": {
          "selected": false,
          "text": "sjyy-analysis-screen-prod",
          "value": "sjyy-analysis-screen-prod"
        },
        "datasource": {
          "type": "prometheus",
          "uid": "b96d2b25-a112-4bac-b48e-de91410c4ecf"
        },
        "definition": "label_values(jvm_classes_loaded_classes{application=\"$application\",job=\"$cloud_env\"}, app)",
        "hide": 2,
        "includeAll": false,
        "label": "deployment",
        "multi": false,
        "name": "app",
        "options": [],
        "query": {
          "query": "label_values(jvm_classes_loaded_classes{application=\"$application\",job=\"$cloud_env\"}, app)",
          "refId": "StandardVariableQuery"
        },
        "refresh": 1,
        "regex": "",
        "skipUrlSync": false,
        "sort": 0,
        "type": "query"
      },
      {
        "current": {
          "selected": false,
          "text": "192.168.0.152:5443",
          "value": "192.168.0.152:5443"
        },
        "datasource": {
          "type": "prometheus",
          "uid": "b96d2b25-a112-4bac-b48e-de91410c4ecf"
        },
        "definition": "label_values(jvm_classes_loaded_classes{application=\"$application\"}, instance)",
        "hide": 2,
        "includeAll": false,
        "label": "Instance",
        "multi": false,
        "name": "instance",
        "options": [],
        "query": {
          "query": "label_values(jvm_classes_loaded_classes{application=\"$application\"}, instance)",
          "refId": "StandardVariableQuery"
        },
        "refresh": 1,
        "regex": "",
        "skipUrlSync": false,
        "sort": 1,
        "tagValuesQuery": "",
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      },
      {
        "current": {
          "selected": false,
          "text": "sjyy-analysis-screen-prod-64c55b9f8b-vlvcd",
          "value": "sjyy-analysis-screen-prod-64c55b9f8b-vlvcd"
        },
        "datasource": {
          "type": "prometheus",
          "uid": "b96d2b25-a112-4bac-b48e-de91410c4ecf"
        },
        "definition": "label_values(jvm_classes_loaded_classes{app=\"$app\"}, pod)",
        "hide": 0,
        "includeAll": false,
        "label": "容器名称",
        "multi": false,
        "name": "pod_name",
        "options": [],
        "query": {
          "query": "label_values(jvm_classes_loaded_classes{app=\"$app\"}, pod)",
          "refId": "StandardVariableQuery"
        },
        "refresh": 1,
        "regex": "",
        "skipUrlSync": false,
        "sort": 0,
        "type": "query"
      }
    ]
  },
  "time": {
    "from": "now-30m",
    "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": "03-应用服务监控",
  "uid": "spring_boot_21",
  "version": 5,
  "weekStart": ""
}

Dashboard展示

在这里插入图片描述

  • 7
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Spring Boot是一个用于创建独立的、基于生产级别的Java应用程序的框架。而Prometheus是一个开源的监控和警报系统,用于记录和查询应用程序的时间序列数据。在Spring Boot中集成Prometheus可以方便地监控和度量应用程序的性能指标。 要在Spring Boot中集成Prometheus自定义Prometheus指标,可以按照以下步骤进行操作: 1. 添加依赖:在Spring Boot项目的pom.xml文件中添加Prometheus相关的依赖。例如: ```xml <dependency> <groupId>io.micrometer</groupId> <artifactId>micrometer-registry-prometheus</artifactId> </dependency> ``` 2. 配置Prometheus:在Spring Boot项目的配置文件(如application.properties或application.yml)中添加Prometheus相关的配置。例如: ```yaml management: endpoints: web: exposure: include: prometheus ``` 这样配置后,Spring Boot会自动将Prometheus监控端点暴露出来。 3. 自定义指标:在代码中使用Micrometer库来定义和记录自定义指标。Micrometer是一个度量库,可以与Prometheus集成。例如,可以使用`Counter`来记录计数器指标,使用`Gauge`来记录度量指标等。以下是一个示例: ```java import io.micrometer.core.instrument.Counter; import io.micrometer.core.instrument.MeterRegistry; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; @Component public class CustomMetrics { private final Counter customCounter; @Autowired public CustomMetrics(MeterRegistry meterRegistry) { customCounter = meterRegistry.counter("custom_counter"); } public void incrementCustomCounter() { customCounter.increment(); } } ``` 在上述示例中,我们定义了一个名为`custom_counter`的计数器指标,并通过`MeterRegistry`将其注册到Micrometer中。 4. 访问指标:启动Spring Boot应用程序后,可以通过访问`/actuator/prometheus`端点来获取Prometheus格式的指标数据。例如,可以使用浏览器或curl命令访问`http://localhost:8080/actuator/prometheus`来获取指标数据。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值