MSE流量防护指标上报到SLS

更新时间:2025-04-03 06:16:42

MSE流量防护以流量为切入点,从流量控制、熔断降级、系统负载保护等多个维度来保障业务的稳定性,提供更专业、稳定的流量防护手段、秒级的流量水位分布分析功能。如果您需要更长时间、更加灵活的指标查询能力,可以通过采集指标日志上报到SLS的方式来满足需求,本文介绍如何将MSE微服务治理流量防护的指标日志采集到SLS。

前提条件

开启日志采集组件

如果在创建ACK集群时已经开启了日志服务,可以跳过该步骤,否则可以按照以下步骤开启日志采集组件。具体操作,请参见创建集群时安装Logtail

说明

此操作仅适用于专有版Kubernetes和托管版Kubernetes。

  1. 登录容器服务管理控制台,在左侧导航栏选择集群列表

  2. 集群列表页面,单击目标集群名称,然后在左侧导航栏,选择运维管理 > 组件管理

  3. 日志与监控页签,找到logtail-ds,然后单击安装

接入数据

设置SLS接入的数据来源。采集Sentinel日志记录并按解析格式上报至SLS。采集文件格式,请参见数据来源与解析格式

  1. 登录日志服务控制台

  2. 在控制台页面单击快速接入数据,在弹窗接入数据区域的搜索框中输入Kubernetes,然后单击Kubernetes-文件

  3. 选择日志空间步骤,选择项目Project日志库Logstore,然后单击下一步

    其中Project选择创建的名为k8s-log-{your_k8s_cluster_id}的Project,也可以选择其他Project。日志库Logstore可以选择已有的或者新建,具体操作,请参见创建Logstore

  4. 机器组配置步骤,选中目标机器组(k8s-group-${your_k8s_cluster_id}),将该机器组从源机器组移动到应用机器组,单击下一步

    如果选择了其他Project,可以按照页面提示创建机器组。

  5. Logtail配置步骤,设置数据来源与解析格式。配置完成后,单击下一步

    配置项

    说明

    配置名称

    输入配置名称

    文件路径

    • 4.3.0以下 Agent 版本:${user_home}/logs/csp/{app_name}-metrics.log.{date}为固定路径进行采集,其中${user_home}替换为系统的主目录。例如系统主目录为root时,配置文件目录为/root/logs/csp,文件名为*-metrics.log*

    • 4.3.0及以上 Agent 版本:/home/admin/.opt/AliyunJavaAgent/logs/sentinel/{app_name}-metrics.log.{date}为固定路径进行采集。配置文件目录为/home/admin/.opt/AliyunJavaAgent/logs/sentinel,文件名为*-metrics.log*

    说明
    • 为兼容新旧版本,建议创建两个文件路径不同,其他配置完全相同的Logtail配置。

    • Agent 版本可以在应用的节点详情查看。

    • 具体路径,请参见重要日志

    日志样例

    1724811932000|2024-08-28 02:25:32|com.alibabacloud.mse.demo.c.service.HelloServiceCTwo|24|0|24|0|1|0|1|202|OUT

    处理模式

    处理插件组合(添加分隔符解析插件,配置如下图)

    image

    image

    image

  6. 查询分析配置步骤,等待预览数据右侧的自动刷新完成。添加并修改部分索引字段,然后单击下一步

    image

日志上报验证

  1. 登录日志服务控制台

  2. Project列表处,单击目标Project,选择目标Logstore,可以看到监控指标已经上报至SLS新建的Logstore中。

    e1b77201e1ce8c167e26077bc663726e

构建图表

完成数据采集后可以根据需求,结合SLS的查询分析语句构建需要的图表,本文给出两个示例以及对应的 JSON,用户需要将提供的 JSON 中的 {project_name} 以及 {logstore_name} 替换成用户自己的 project_name 和 logstore_name 后,在 SLS 对应 project 下的仪表盘页面,点击 + (新建仪表盘),点击添加 JSON 仪表盘,复制修改后的 JSON 即可。

概览

image

image

展开Json

{
  "displayName": "概览",
  "attribute": {
    "type": "grid"
  },
  "charts": [
    {
      "search": {
        "isInheritFilter": false,
        "query": "@",
        "start": "-900s",
        "timeSpanType": "",
        "topic": "",
        "end": "now",
        "chartQueries": [
          {
            "datasource": "logstore",
            "query": "",
            "name": "A",
            "tokenQuery": "SELECT DISTINCT (namespace)",
            "project": "{project_name}",
            "logstore": "{logstore_name}"
          }
        ],
        "logstore": "@",
        "dataSourceType": "mixed"
      },
      "display": {
        "yPos": 0,
        "displayName": "",
        "bindQuery": true,
        "width": 12,
        "showDropListChart": true,
        "basicOptions": {
          "displayName": "命名空间",
          "showTitle": true,
          "showBackground": true,
          "showTime": false,
          "showBorder": true
        },
        "dropListOption": {
          "autoFilter": false,
          "alias": "namespace",
          "globalFilter": false,
          "logic": "and",
          "list": [],
          "type": "filter",
          "listAlias": [],
          "key": "__tag__:_namespace_",
          "listDefault": []
        },
        "xPos": 0,
        "version": "2",
        "height": 2
      },
      "action": {},
      "title": "metrics-namespace",
      "type": "droplistpro"
    },
    {
      "search": {
        "isInheritFilter": false,
        "query": "@",
        "start": "-900s",
        "timeSpanType": "",
        "topic": "",
        "end": "now",
        "chartQueries": [
          {
            "datasource": "logstore",
            "query": "",
            "name": "A",
            "tokenQuery": "SELECT DISTINCT (app_name)",
            "project": "{project_name}",
            "logstore": "{logstore_name}"
          }
        ],
        "logstore": "@",
        "dataSourceType": "mixed"
      },
      "display": {
        "yPos": 0,
        "displayName": "",
        "bindQuery": true,
        "width": 12,
        "showDropListChart": true,
        "basicOptions": {
          "displayName": "应用名",
          "showTitle": true,
          "showBackground": true,
          "showTime": false,
          "showBorder": true
        },
        "dropListOption": {
          "autoFilter": false,
          "alias": "app_name",
          "globalFilter": false,
          "logic": "and",
          "list": [],
          "type": "filter",
          "listAlias": [],
          "key": "__tag__:_container_name_",
          "listDefault": []
        },
        "xPos": 12,
        "version": "2",
        "height": 2
      },
      "action": {},
      "title": "metrics-app-name",
      "type": "droplistpro"
    },
    {
      "search": {
        "query": "@",
        "start": "-900s",
        "topic": "",
        "end": "now",
        "chartQueries": [
          {
            "datasource": "logstore",
            "query": "* and resource_name: __total_inbound_traffic__ | select sum(passed_qps+blocked_qps) as qps, app_name, timestamp group by app_name, timestamp order by timestamp limit 100000",
            "name": "A",
            "tokenQuery": "* and resource_name: __total_inbound_traffic__ | select sum(passed_qps+blocked_qps) as qps, app_name, timestamp group by app_name, timestamp order by timestamp limit 100000",
            "project": "{project_name}",
            "logstore": "{logstore_name}"
          }
        ],
        "logstore": "@",
        "dataSourceType": "current"
      },
      "display": {
        "queryOptionMap": {
          "A": {
            "yAxisKey": "qps",
            "xAxisKey": "timestamp",
            "name": "A",
            "aggField": "app_name"
          }
        },
        "yPos": 2,
        "standardOption": {
          "unit": {
            "unit": "none"
          },
          "format": "none"
        },
        "displayName": "",
        "yAxisOption": {
          "stackingMode": "none",
          "show": true,
          "position": 3
        },
        "tooltipOption": {
          "mode": "all",
          "labelFormat": "",
          "sortOrder": "none"
        },
        "xAxisOption": {
          "timeRangeMode": "dataTime",
          "format": {
            "value": "auto"
          },
          "show": true,
          "zoomTarget": "global"
        },
        "xPos": 0,
        "actionOptions": [],
        "dataOption": {
          "autoFill": false,
          "maxClassifyGroupNum": 50,
          "autoFillNumber": 0
        },
        "version": "2",
        "isTimeSeries": true,
        "thresholdOption": {
          "fillOpacity": 40
        },
        "aggChartOption": {
          "chartType": "line"
        },
        "width": 24,
        "legendOption": {
          "maxContent": 30,
          "actionMode": "toggle",
          "sortOrder": "none",
          "show": true,
          "position": "bottom"
        },
        "barOptions": {
          "barWidth": 0.9,
          "orientation": "vertical",
          "showValues": "auto",
          "fillOpacity": 85,
          "stackingMode": "none",
          "valueSize": 12,
          "groupWidth": 0.7,
          "labelLocation": "xAxis",
          "gradientMode": "none",
          "lineWidth": 1
        },
        "basicOptions": {
          "displayName": "总 QPS",
          "showTitle": true,
          "showBackground": true,
          "showTime": true,
          "showBorder": true
        },
        "graphOptions": {
          "pointSize": 6,
          "fillOpacity": 40,
          "showPoint": "none",
          "lineInterpolation": "smooth",
          "barStyle": "middle",
          "gradientMode": "opacity",
          "lineWidth": 1.5,
          "seriesStyle": "lines"
        },
        "innerTokenOption": [],
        "documentLinkOption": {
          "showIcon": true,
          "documentLinks": []
        },
        "height": 8
      },
      "action": {},
      "title": "metrics-qps",
      "type": "aggpro"
    },
    {
      "search": {
        "query": "@",
        "start": "-900s",
        "topic": "",
        "end": "now",
        "chartQueries": [
          {
            "datasource": "logstore",
            "query": "* and resource_name: __total_inbound_traffic__ | select sum(passed_qps) as passed_qps, app_name, timestamp group by app_name, timestamp order by timestamp limit 100000",
            "name": "A",
            "tokenQuery": "* and resource_name: __total_inbound_traffic__ | select sum(passed_qps) as passed_qps, app_name, timestamp group by app_name, timestamp order by timestamp limit 100000",
            "project": "{project_name}",
            "logstore": "{logstore_name}"
          }
        ],
        "logstore": "@",
        "dataSourceType": "current"
      },
      "display": {
        "queryOptionMap": {
          "A": {
            "yAxisKey": "passed_qps",
            "xAxisKey": "timestamp",
            "name": "A",
            "aggField": "app_name"
          }
        },
        "yPos": 10,
        "standardOption": {
          "unit": {
            "unit": "none"
          },
          "format": "none"
        },
        "displayName": "",
        "yAxisOption": {
          "stackingMode": "none",
          "show": true,
          "position": 3
        },
        "tooltipOption": {
          "mode": "all",
          "labelFormat": "",
          "sortOrder": "none"
        },
        "xAxisOption": {
          "timeRangeMode": "dataTime",
          "format": {
            "value": "auto"
          },
          "show": true,
          "zoomTarget": "global"
        },
        "xPos": 0,
        "actionOptions": [],
        "dataOption": {
          "autoFill": false,
          "maxClassifyGroupNum": 50,
          "autoFillNumber": 0
        },
        "version": "2",
        "isTimeSeries": true,
        "thresholdOption": {
          "fillOpacity": 40
        },
        "aggChartOption": {
          "chartType": "line"
        },
        "width": 12,
        "legendOption": {
          "maxContent": 30,
          "actionMode": "toggle",
          "sortOrder": "none",
          "show": true,
          "position": "bottom"
        },
        "barOptions": {
          "barWidth": 0.9,
          "orientation": "vertical",
          "showValues": "auto",
          "fillOpacity": 85,
          "stackingMode": "none",
          "valueSize": 12,
          "groupWidth": 0.7,
          "labelLocation": "xAxis",
          "gradientMode": "none",
          "lineWidth": 1
        },
        "basicOptions": {
          "displayName": "通过 QPS",
          "showTitle": true,
          "showBackground": true,
          "showTime": true,
          "showBorder": true
        },
        "graphOptions": {
          "pointSize": 6,
          "fillOpacity": 40,
          "showPoint": "none",
          "lineInterpolation": "smooth",
          "barStyle": "middle",
          "gradientMode": "opacity",
          "lineWidth": 1.5,
          "seriesStyle": "lines"
        },
        "innerTokenOption": [],
        "documentLinkOption": {
          "showIcon": true,
          "documentLinks": []
        },
        "height": 8
      },
      "action": {},
      "title": "metrics-passed",
      "type": "aggpro"
    },
    {
      "search": {
        "query": "@",
        "start": "-900s",
        "topic": "",
        "end": "now",
        "chartQueries": [
          {
            "datasource": "logstore",
            "query": "* and resource_name: __total_inbound_traffic__ | select sum(blocked_qps) as blocked_qps, app_name, timestamp group by app_name, timestamp order by timestamp limit 100000",
            "name": "A",
            "tokenQuery": "* and resource_name: __total_inbound_traffic__ | select sum(blocked_qps) as blocked_qps, app_name, timestamp group by app_name, timestamp order by timestamp limit 100000",
            "project": "{project_name}",
            "logstore": "{logstore_name}"
          }
        ],
        "logstore": "@",
        "dataSourceType": "current"
      },
      "display": {
        "queryOptionMap": {
          "A": {
            "yAxisKey": "blocked_qps",
            "xAxisKey": "timestamp",
            "name": "A",
            "aggField": "app_name"
          }
        },
        "yPos": 10,
        "standardOption": {
          "unit": {
            "unit": "none"
          },
          "format": "none"
        },
        "displayName": "",
        "yAxisOption": {
          "stackingMode": "none",
          "show": true,
          "position": 3
        },
        "tooltipOption": {
          "mode": "all",
          "labelFormat": "",
          "sortOrder": "none"
        },
        "xAxisOption": {
          "timeRangeMode": "dataTime",
          "format": {
            "value": "auto"
          },
          "show": true,
          "zoomTarget": "global"
        },
        "xPos": 12,
        "actionOptions": [],
        "dataOption": {
          "autoFill": false,
          "maxClassifyGroupNum": 50,
          "autoFillNumber": 0
        },
        "version": "2",
        "isTimeSeries": true,
        "thresholdOption": {
          "fillOpacity": 40
        },
        "aggChartOption": {
          "chartType": "line"
        },
        "width": 12,
        "legendOption": {
          "maxContent": 30,
          "actionMode": "toggle",
          "sortOrder": "none",
          "show": true,
          "position": "bottom"
        },
        "barOptions": {
          "barWidth": 0.9,
          "orientation": "vertical",
          "showValues": "auto",
          "fillOpacity": 85,
          "stackingMode": "none",
          "valueSize": 12,
          "groupWidth": 0.7,
          "labelLocation": "xAxis",
          "gradientMode": "none",
          "lineWidth": 1
        },
        "basicOptions": {
          "displayName": "拒绝 QPS",
          "showTitle": true,
          "showBackground": true,
          "showTime": true,
          "showBorder": true
        },
        "graphOptions": {
          "pointSize": 6,
          "fillOpacity": 40,
          "showPoint": "none",
          "lineInterpolation": "smooth",
          "barStyle": "middle",
          "gradientMode": "opacity",
          "lineWidth": 1.5,
          "seriesStyle": "lines"
        },
        "innerTokenOption": [],
        "documentLinkOption": {
          "showIcon": true,
          "documentLinks": []
        },
        "height": 8
      },
      "action": {},
      "title": "metrics-blocked",
      "type": "aggpro"
    },
    {
      "search": {
        "query": "@",
        "start": "-900s",
        "topic": "",
        "end": "now",
        "chartQueries": [
          {
            "datasource": "logstore",
            "query": "* and resource_name: __total_inbound_traffic__ | select sum(exception_qps) as exception_qps, app_name, timestamp group by app_name, timestamp order by timestamp limit 100000",
            "name": "A",
            "tokenQuery": "* and resource_name: __total_inbound_traffic__ | select sum(exception_qps) as exception_qps, app_name, timestamp group by app_name, timestamp order by timestamp limit 100000",
            "project": "{project_name}",
            "logstore": "{logstore_name}"
          }
        ],
        "logstore": "@",
        "dataSourceType": "current"
      },
      "display": {
        "queryOptionMap": {
          "A": {
            "yAxisKey": "exception_qps",
            "xAxisKey": "timestamp",
            "name": "A",
            "aggField": "app_name"
          }
        },
        "yPos": 18,
        "standardOption": {
          "unit": {
            "unit": "none"
          },
          "format": "none"
        },
        "displayName": "",
        "yAxisOption": {
          "stackingMode": "none",
          "show": true,
          "position": 3
        },
        "tooltipOption": {
          "mode": "all",
          "labelFormat": "",
          "sortOrder": "none"
        },
        "xAxisOption": {
          "timeRangeMode": "dataTime",
          "format": {
            "value": "auto"
          },
          "show": true,
          "zoomTarget": "global"
        },
        "xPos": 0,
        "actionOptions": [],
        "dataOption": {
          "autoFill": false,
          "maxClassifyGroupNum": 50,
          "autoFillNumber": 0
        },
        "version": "2",
        "isTimeSeries": true,
        "thresholdOption": {
          "fillOpacity": 40
        },
        "aggChartOption": {
          "chartType": "line"
        },
        "width": 12,
        "legendOption": {
          "maxContent": 30,
          "actionMode": "toggle",
          "sortOrder": "none",
          "show": true,
          "position": "bottom"
        },
        "barOptions": {
          "barWidth": 0.9,
          "orientation": "vertical",
          "showValues": "auto",
          "fillOpacity": 85,
          "stackingMode": "none",
          "valueSize": 12,
          "groupWidth": 0.7,
          "labelLocation": "xAxis",
          "gradientMode": "none",
          "lineWidth": 1
        },
        "basicOptions": {
          "displayName": "异常 QPS",
          "showTitle": true,
          "showBackground": true,
          "showTime": true,
          "showBorder": true
        },
        "graphOptions": {
          "pointSize": 6,
          "fillOpacity": 40,
          "showPoint": "none",
          "lineInterpolation": "smooth",
          "barStyle": "middle",
          "gradientMode": "opacity",
          "lineWidth": 1.5,
          "seriesStyle": "lines"
        },
        "innerTokenOption": [],
        "documentLinkOption": {
          "showIcon": true,
          "documentLinks": []
        },
        "height": 8
      },
      "action": {},
      "title": "metrics-exception",
      "type": "aggpro"
    },
    {
      "search": {
        "query": "@",
        "start": "-900s",
        "topic": "",
        "end": "now",
        "chartQueries": [
          {
            "datasource": "logstore",
            "query": "* and resource_name: __total_inbound_traffic__ | select sum(completed_qps) as completed_qps, app_name, timestamp group by app_name, timestamp order by timestamp limit 100000",
            "name": "A",
            "tokenQuery": "* and resource_name: __total_inbound_traffic__ | select sum(completed_qps) as completed_qps, app_name, timestamp group by app_name, timestamp order by timestamp limit 100000",
            "project": "{project_name}",
            "logstore": "{logstore_name}"
          }
        ],
        "logstore": "@",
        "dataSourceType": "current"
      },
      "display": {
        "queryOptionMap": {
          "A": {
            "yAxisKey": "completed_qps",
            "xAxisKey": "timestamp",
            "name": "A",
            "aggField": "app_name"
          }
        },
        "yPos": 18,
        "standardOption": {
          "unit": {
            "unit": "none"
          },
          "format": "none"
        },
        "displayName": "",
        "yAxisOption": {
          "stackingMode": "none",
          "show": true,
          "position": 3
        },
        "tooltipOption": {
          "mode": "all",
          "labelFormat": "",
          "sortOrder": "none"
        },
        "xAxisOption": {
          "timeRangeMode": "dataTime",
          "format": {
            "value": "auto"
          },
          "show": true,
          "zoomTarget": "global"
        },
        "xPos": 12,
        "actionOptions": [],
        "dataOption": {
          "autoFill": false,
          "maxClassifyGroupNum": 50,
          "autoFillNumber": 0
        },
        "version": "2",
        "isTimeSeries": true,
        "thresholdOption": {
          "fillOpacity": 40
        },
        "aggChartOption": {
          "chartType": "line"
        },
        "width": 12,
        "legendOption": {
          "maxContent": 30,
          "actionMode": "toggle",
          "sortOrder": "none",
          "show": true,
          "position": "bottom"
        },
        "barOptions": {
          "barWidth": 0.9,
          "orientation": "vertical",
          "showValues": "auto",
          "fillOpacity": 85,
          "stackingMode": "none",
          "valueSize": 12,
          "groupWidth": 0.7,
          "labelLocation": "xAxis",
          "gradientMode": "none",
          "lineWidth": 1
        },
        "basicOptions": {
          "displayName": "完成 QPS",
          "showTitle": true,
          "showBackground": true,
          "showTime": true,
          "showBorder": true
        },
        "graphOptions": {
          "pointSize": 6,
          "fillOpacity": 40,
          "showPoint": "none",
          "lineInterpolation": "smooth",
          "barStyle": "middle",
          "gradientMode": "opacity",
          "lineWidth": 1.5,
          "seriesStyle": "lines"
        },
        "innerTokenOption": [],
        "documentLinkOption": {
          "showIcon": true,
          "documentLinks": []
        },
        "height": 8
      },
      "action": {},
      "title": "metrics-completed",
      "type": "aggpro"
    },
    {
      "search": {
        "query": "@",
        "start": "-900s",
        "topic": "",
        "end": "now",
        "chartQueries": [
          {
            "datasource": "logstore",
            "query": "* and resource_name: __total_inbound_traffic__ | select sum(concurrency) as concurrency, app_name, timestamp group by app_name, timestamp order by timestamp limit 100000",
            "name": "A",
            "tokenQuery": "* and resource_name: __total_inbound_traffic__ | select sum(concurrency) as concurrency, app_name, timestamp group by app_name, timestamp order by timestamp limit 100000",
            "project": "{project_name}",
            "logstore": "{logstore_name}"
          }
        ],
        "logstore": "@",
        "dataSourceType": "current"
      },
      "display": {
        "queryOptionMap": {
          "A": {
            "yAxisKey": "concurrency",
            "xAxisKey": "timestamp",
            "name": "A",
            "aggField": "app_name"
          }
        },
        "yPos": 26,
        "standardOption": {
          "unit": {
            "unit": "none"
          },
          "format": "none"
        },
        "displayName": "",
        "yAxisOption": {
          "stackingMode": "none",
          "show": true,
          "position": 3
        },
        "tooltipOption": {
          "mode": "all",
          "labelFormat": "",
          "sortOrder": "none"
        },
        "xAxisOption": {
          "timeRangeMode": "dataTime",
          "format": {
            "value": "auto"
          },
          "show": true,
          "zoomTarget": "global"
        },
        "xPos": 0,
        "actionOptions": [],
        "dataOption": {
          "autoFill": false,
          "maxClassifyGroupNum": 50,
          "autoFillNumber": 0
        },
        "version": "2",
        "isTimeSeries": true,
        "thresholdOption": {
          "fillOpacity": 40
        },
        "aggChartOption": {
          "chartType": "line"
        },
        "width": 12,
        "legendOption": {
          "maxContent": 30,
          "actionMode": "toggle",
          "sortOrder": "none",
          "show": true,
          "position": "bottom"
        },
        "barOptions": {
          "barWidth": 0.9,
          "orientation": "vertical",
          "showValues": "auto",
          "fillOpacity": 85,
          "stackingMode": "none",
          "valueSize": 12,
          "groupWidth": 0.7,
          "labelLocation": "xAxis",
          "gradientMode": "none",
          "lineWidth": 1
        },
        "basicOptions": {
          "displayName": "并发",
          "showTitle": true,
          "showBackground": true,
          "showTime": true,
          "showBorder": true
        },
        "graphOptions": {
          "pointSize": 6,
          "fillOpacity": 40,
          "showPoint": "none",
          "lineInterpolation": "smooth",
          "barStyle": "middle",
          "gradientMode": "opacity",
          "lineWidth": 1.5,
          "seriesStyle": "lines"
        },
        "innerTokenOption": [],
        "documentLinkOption": {
          "showIcon": true,
          "documentLinks": []
        },
        "height": 8
      },
      "action": {},
      "title": "metrics-concurrency",
      "type": "aggpro"
    },
    {
      "search": {
        "query": "@",
        "start": "-900s",
        "topic": "",
        "end": "now",
        "chartQueries": [
          {
            "datasource": "logstore",
            "query": "* and resource_name: __total_inbound_traffic__ | select sum(avg_rt*passed_qps)/sum(passed_qps) as avg_rt, app_name, timestamp group by app_name, timestamp order by timestamp limit 100000",
            "name": "A",
            "tokenQuery": "* and resource_name: __total_inbound_traffic__ | select sum(avg_rt*passed_qps)/sum(passed_qps) as avg_rt, app_name, timestamp group by app_name, timestamp order by timestamp limit 100000",
            "project": "{project_name}",
            "logstore": "{logstore_name}"
          }
        ],
        "logstore": "@",
        "dataSourceType": "current"
      },
      "display": {
        "queryOptionMap": {
          "A": {
            "yAxisKey": "avg_rt",
            "xAxisKey": "timestamp",
            "name": "A",
            "aggField": "app_name"
          }
        },
        "yPos": 26,
        "standardOption": {
          "unit": {
            "unit": "none"
          },
          "format": "none"
        },
        "displayName": "",
        "yAxisOption": {
          "stackingMode": "none",
          "show": true,
          "position": 3
        },
        "tooltipOption": {
          "mode": "all",
          "labelFormat": "",
          "sortOrder": "none"
        },
        "xAxisOption": {
          "timeRangeMode": "dataTime",
          "format": {
            "value": "auto"
          },
          "show": true,
          "zoomTarget": "global"
        },
        "xPos": 12,
        "actionOptions": [],
        "dataOption": {
          "autoFill": false,
          "maxClassifyGroupNum": 50,
          "autoFillNumber": 0
        },
        "version": "2",
        "isTimeSeries": true,
        "thresholdOption": {
          "fillOpacity": 40
        },
        "aggChartOption": {
          "chartType": "line"
        },
        "width": 12,
        "legendOption": {
          "maxContent": 30,
          "actionMode": "toggle",
          "sortOrder": "none",
          "show": true,
          "position": "bottom"
        },
        "barOptions": {
          "barWidth": 0.9,
          "orientation": "vertical",
          "showValues": "auto",
          "fillOpacity": 85,
          "stackingMode": "none",
          "valueSize": 12,
          "groupWidth": 0.7,
          "labelLocation": "xAxis",
          "gradientMode": "none",
          "lineWidth": 1
        },
        "basicOptions": {
          "displayName": "平均 RT",
          "showTitle": true,
          "showBackground": true,
          "showTime": true,
          "showBorder": true
        },
        "graphOptions": {
          "pointSize": 6,
          "fillOpacity": 40,
          "showPoint": "none",
          "lineInterpolation": "smooth",
          "barStyle": "middle",
          "gradientMode": "opacity",
          "lineWidth": 1.5,
          "seriesStyle": "lines"
        },
        "innerTokenOption": [],
        "documentLinkOption": {
          "showIcon": true,
          "documentLinks": []
        },
        "height": 8
      },
      "action": {},
      "title": "metrics-avgrt",
      "type": "aggpro"
    }
  ]
}

详情

image

image

展开Json

{
  "displayName": "详情",
  "attribute": {
    "type": "grid"
  },
  "charts": [
    {
      "search": {
        "isInheritFilter": false,
        "query": "@",
        "start": "-900s",
        "timeSpanType": "",
        "topic": "",
        "end": "now",
        "chartQueries": [
          {
            "datasource": "logstore",
            "query": "",
            "name": "A",
            "tokenQuery": "SELECT DISTINCT (namespace)",
            "project": "{project_name}",
            "logstore": "{logstore_name}"
          }
        ],
        "logstore": "@",
        "dataSourceType": "mixed"
      },
      "display": {
        "yPos": 0,
        "displayName": "",
        "bindQuery": true,
        "width": 6,
        "showDropListChart": true,
        "basicOptions": {
          "displayName": "命名空间",
          "showTitle": true,
          "showBackground": true,
          "showTime": false,
          "showBorder": true
        },
        "dropListOption": {
          "autoFilter": false,
          "alias": "namespace",
          "globalFilter": false,
          "logic": "and",
          "list": [],
          "type": "filter",
          "listAlias": [],
          "key": "__tag__:_namespace_",
          "listDefault": []
        },
        "xPos": 0,
        "version": "2",
        "height": 2
      },
      "action": {},
      "title": "metrics-namespace",
      "type": "droplistpro"
    },
    {
      "search": {
        "isInheritFilter": false,
        "query": "@",
        "start": "-900s",
        "timeSpanType": "",
        "topic": "",
        "end": "now",
        "chartQueries": [
          {
            "datasource": "logstore",
            "query": "",
            "name": "A",
            "tokenQuery": "SELECT DISTINCT (app_name)",
            "project": "{project_name}",
            "logstore": "{logstore_name}"
          }
        ],
        "logstore": "@",
        "dataSourceType": "mixed"
      },
      "display": {
        "yPos": 0,
        "displayName": "",
        "bindQuery": true,
        "width": 6,
        "showDropListChart": true,
        "basicOptions": {
          "displayName": "应用名",
          "showTitle": true,
          "showBackground": true,
          "showTime": false,
          "showBorder": true
        },
        "dropListOption": {
          "autoFilter": false,
          "alias": "app_name",
          "globalFilter": false,
          "logic": "and",
          "list": [],
          "type": "filter",
          "listAlias": [],
          "key": "__tag__:_container_name_",
          "listDefault": []
        },
        "xPos": 6,
        "version": "2",
        "height": 2
      },
      "action": {},
      "title": "metrics-app-name",
      "type": "droplistpro"
    },
    {
      "search": {
        "isInheritFilter": false,
        "query": "@",
        "start": "-900s",
        "timeSpanType": "",
        "topic": "",
        "end": "now",
        "chartQueries": [
          {
            "datasource": "logstore",
            "query": "",
            "name": "A",
            "tokenQuery": "SELECT DISTINCT (ip)",
            "project": "{project_name}",
            "logstore": "{logstore_name}"
          }
        ],
        "logstore": "@",
        "dataSourceType": "mixed"
      },
      "display": {
        "yPos": 0,
        "displayName": "",
        "bindQuery": true,
        "width": 6,
        "showDropListChart": true,
        "basicOptions": {
          "displayName": "节点 ip",
          "showTitle": true,
          "showBackground": true,
          "showTime": false,
          "showBorder": true
        },
        "dropListOption": {
          "autoFilter": false,
          "alias": "ip",
          "globalFilter": false,
          "logic": "and",
          "list": [],
          "type": "filter",
          "listAlias": [],
          "key": "__tag__:_container_ip_",
          "listDefault": []
        },
        "xPos": 12,
        "version": "2",
        "height": 2
      },
      "action": {},
      "title": "metrics-ip",
      "type": "droplistpro"
    },
    {
      "search": {
        "isInheritFilter": false,
        "query": "@",
        "start": "-900s",
        "timeSpanType": "",
        "topic": "",
        "end": "now",
        "chartQueries": [
          {
            "datasource": "logstore",
            "query": "",
            "name": "A",
            "tokenQuery": "",
            "project": "",
            "logstore": ""
          }
        ],
        "logstore": "@",
        "dataSourceType": "mixed"
      },
      "display": {
        "yPos": 0,
        "displayName": "",
        "bindQuery": false,
        "width": 6,
        "showDropListChart": true,
        "basicOptions": {
          "displayName": "聚合维度",
          "showTitle": true,
          "showBackground": true,
          "showTime": false,
          "showBorder": true
        },
        "dropListOption": {
          "tokenDefault": [
            true,
            false
          ],
          "alias": "groupby",
          "multipleToken": false,
          "showType": "select",
          "list": [
            "resource_name",
            "ip"
          ],
          "type": "token",
          "listAlias": [
            "接口名(资源名)",
            "节点ip"
          ],
          "key": "groupby",
          "multipleTokenKey": ""
        },
        "xPos": 18,
        "version": "2",
        "height": 2
      },
      "action": {},
      "title": "metrics-groupby",
      "type": "droplistpro"
    },
    {
      "search": {
        "isInheritFilter": false,
        "query": "@",
        "start": "-900s",
        "timeSpanType": "",
        "topic": "",
        "end": "now",
        "chartQueries": [
          {
            "datasource": "logstore",
            "query": "",
            "name": "A",
            "tokenQuery": "resource_name not null | SELECT DISTINCT (resource_name) ",
            "project": "{project_name}",
            "logstore": "{logstore_name}"
          }
        ],
        "logstore": "@",
        "dataSourceType": "mixed"
      },
      "display": {
        "yPos": 2,
        "displayName": "",
        "bindQuery": true,
        "width": 12,
        "showDropListChart": true,
        "basicOptions": {
          "displayName": "资源名(接口名)",
          "showTitle": true,
          "showBackground": true,
          "showTime": false,
          "showBorder": true
        },
        "dropListOption": {
          "autoFilter": false,
          "alias": "",
          "globalFilter": false,
          "logic": "and",
          "list": [],
          "type": "filter",
          "listAlias": [],
          "key": "resource_name",
          "listDefault": []
        },
        "xPos": 0,
        "version": "2",
        "height": 2
      },
      "action": {},
      "title": "metrics-resource-name",
      "type": "droplistpro"
    },
    {
      "search": {
        "isInheritFilter": false,
        "query": "@",
        "start": "-900s",
        "timeSpanType": "",
        "topic": "",
        "end": "now",
        "chartQueries": [
          {
            "datasource": "logstore",
            "query": "",
            "name": "A",
            "tokenQuery": "SELECT DISTINCT (resource_type) ",
            "project": "{project_name}",
            "logstore": "{logstore_name}"
          }
        ],
        "logstore": "@",
        "dataSourceType": "mixed"
      },
      "display": {
        "yPos": 2,
        "displayName": "",
        "bindQuery": true,
        "width": 12,
        "showDropListChart": true,
        "basicOptions": {
          "displayName": "资源分类",
          "showTitle": true,
          "showBackground": true,
          "showTime": false,
          "showBorder": true
        },
        "dropListOption": {
          "autoFilter": false,
          "alias": "",
          "globalFilter": false,
          "logic": "and",
          "list": [],
          "type": "filter",
          "listAlias": [],
          "key": "resource_type",
          "listDefault": []
        },
        "xPos": 12,
        "version": "2",
        "height": 2
      },
      "action": {},
      "title": "metrics-resource-type",
      "type": "droplistpro"
    },
    {
      "search": {
        "query": "@",
        "start": "-300s",
        "topic": "",
        "end": "now",
        "chartQueries": [
          {
            "datasource": "logstore",
            "query": "* | select sum(passed_qps+blocked_qps) as qps, resource_name as groupBy , timestamp group by resource_name, timestamp order by timestamp limit 100000",
            "name": "A",
            "tokenQuery": "* | select sum(passed_qps+blocked_qps) as qps, ${{groupby|resource_name}} as groupBy , timestamp group by ${{groupby|resource_name}}, timestamp order by timestamp limit 100000",
            "project": "{project_name}",
            "logstore": "{logstore_name}"
          }
        ],
        "logstore": "@",
        "dataSourceType": "current"
      },
      "display": {
        "queryOptionMap": {
          "A": {
            "yAxisKey": "qps",
            "xAxisKey": "timestamp",
            "name": "A",
            "aggField": "groupBy"
          }
        },
        "yPos": 4,
        "standardOption": {
          "unit": {
            "unit": "none"
          },
          "format": "none"
        },
        "displayName": "",
        "yAxisOption": {
          "stackingMode": "none",
          "show": true,
          "position": 3
        },
        "tooltipOption": {
          "mode": "all",
          "labelFormat": "",
          "sortOrder": "none"
        },
        "xAxisOption": {
          "timeRangeMode": "dataTime",
          "format": {
            "value": "auto"
          },
          "show": true,
          "zoomTarget": "global"
        },
        "xPos": 0,
        "actionOptions": [],
        "dataOption": {
          "autoFill": false,
          "maxClassifyGroupNum": 50,
          "autoFillNumber": 0
        },
        "version": "2",
        "isTimeSeries": true,
        "thresholdOption": {
          "fillOpacity": 40
        },
        "aggChartOption": {
          "chartType": "line"
        },
        "width": 24,
        "legendOption": {
          "maxContent": 30,
          "actionMode": "toggle",
          "sortOrder": "none",
          "show": true,
          "position": "bottom"
        },
        "barOptions": {
          "barWidth": 0.9,
          "orientation": "vertical",
          "showValues": "auto",
          "fillOpacity": 85,
          "stackingMode": "none",
          "valueSize": 12,
          "groupWidth": 0.7,
          "labelLocation": "xAxis",
          "gradientMode": "none",
          "lineWidth": 1
        },
        "basicOptions": {
          "displayName": "QPS",
          "showTitle": true,
          "showBackground": true,
          "showTime": true,
          "showBorder": true
        },
        "graphOptions": {
          "pointSize": 6,
          "fillOpacity": 40,
          "showPoint": "none",
          "lineInterpolation": "smooth",
          "barStyle": "middle",
          "gradientMode": "opacity",
          "lineWidth": 1.5,
          "seriesStyle": "lines"
        },
        "innerTokenOption": [],
        "documentLinkOption": {
          "showIcon": true,
          "documentLinks": []
        },
        "height": 8
      },
      "action": {},
      "title": "metrics-qps",
      "type": "aggpro"
    },
    {
      "search": {
        "query": "@",
        "start": "-900s",
        "topic": "",
        "end": "now",
        "chartQueries": [
          {
            "datasource": "logstore",
            "query": "* | select sum(passed_qps) as passed_qps, resource_name as groupBy, timestamp group by resource_name, timestamp order by timestamp limit 100000",
            "name": "A",
            "tokenQuery": "* | select sum(passed_qps) as passed_qps, ${{groupby|resource_name}} as groupBy, timestamp group by ${{groupby|resource_name}}, timestamp order by timestamp limit 100000",
            "project": "{project_name}",
            "logstore": "{logstore_name}"
          }
        ],
        "logstore": "@",
        "dataSourceType": "current"
      },
      "display": {
        "queryOptionMap": {
          "A": {
            "yAxisKey": "passed_qps",
            "xAxisKey": "timestamp",
            "name": "A",
            "aggField": "groupBy"
          }
        },
        "yPos": 12,
        "standardOption": {
          "unit": {
            "unit": "none"
          },
          "format": "none"
        },
        "displayName": "",
        "yAxisOption": {
          "stackingMode": "none",
          "show": true,
          "position": 3
        },
        "tooltipOption": {
          "mode": "all",
          "labelFormat": "",
          "sortOrder": "none"
        },
        "xAxisOption": {
          "timeRangeMode": "dataTime",
          "format": {
            "value": "auto"
          },
          "show": true,
          "zoomTarget": "global"
        },
        "xPos": 0,
        "actionOptions": [],
        "dataOption": {
          "autoFill": false,
          "maxClassifyGroupNum": 50,
          "autoFillNumber": 0
        },
        "version": "2",
        "isTimeSeries": true,
        "thresholdOption": {
          "fillOpacity": 40
        },
        "aggChartOption": {
          "chartType": "line"
        },
        "width": 12,
        "legendOption": {
          "maxContent": 30,
          "actionMode": "toggle",
          "sortOrder": "none",
          "show": true,
          "position": "bottom"
        },
        "barOptions": {
          "barWidth": 0.9,
          "orientation": "vertical",
          "showValues": "auto",
          "fillOpacity": 85,
          "stackingMode": "none",
          "valueSize": 12,
          "groupWidth": 0.7,
          "labelLocation": "xAxis",
          "gradientMode": "none",
          "lineWidth": 1
        },
        "basicOptions": {
          "displayName": "通过 QPS",
          "showTitle": true,
          "showBackground": true,
          "showTime": true,
          "showBorder": true
        },
        "graphOptions": {
          "pointSize": 6,
          "fillOpacity": 40,
          "showPoint": "none",
          "lineInterpolation": "smooth",
          "barStyle": "middle",
          "gradientMode": "opacity",
          "lineWidth": 1.5,
          "seriesStyle": "lines"
        },
        "innerTokenOption": [],
        "documentLinkOption": {
          "showIcon": true,
          "documentLinks": []
        },
        "height": 8
      },
      "action": {},
      "title": "metrics-passed",
      "type": "aggpro"
    },
    {
      "search": {
        "query": "@",
        "start": "-900s",
        "topic": "",
        "end": "now",
        "chartQueries": [
          {
            "datasource": "logstore",
            "query": "* | select sum(blocked_qps) as blocked_qps, resource_name as groupBy, timestamp group by resource_name, timestamp order by timestamp limit 100000",
            "name": "A",
            "tokenQuery": "* | select sum(blocked_qps) as blocked_qps, ${{groupby|resource_name}} as groupBy, timestamp group by ${{groupby|resource_name}}, timestamp order by timestamp limit 100000",
            "project": "{project_name}",
            "logstore": "{logstore_name}"
          }
        ],
        "logstore": "@",
        "dataSourceType": "current"
      },
      "display": {
        "queryOptionMap": {
          "A": {
            "yAxisKey": "blocked_qps",
            "xAxisKey": "timestamp",
            "name": "A",
            "aggField": "groupBy"
          }
        },
        "yPos": 12,
        "standardOption": {
          "unit": {
            "unit": "none"
          },
          "format": "none"
        },
        "displayName": "",
        "yAxisOption": {
          "stackingMode": "none",
          "show": true,
          "position": 3
        },
        "tooltipOption": {
          "mode": "all",
          "labelFormat": "",
          "sortOrder": "none"
        },
        "xAxisOption": {
          "timeRangeMode": "dataTime",
          "format": {
            "value": "auto"
          },
          "show": true,
          "zoomTarget": "global"
        },
        "xPos": 12,
        "actionOptions": [],
        "dataOption": {
          "autoFill": false,
          "maxClassifyGroupNum": 50,
          "autoFillNumber": 0
        },
        "version": "2",
        "isTimeSeries": true,
        "thresholdOption": {
          "fillOpacity": 40
        },
        "aggChartOption": {
          "chartType": "line"
        },
        "width": 12,
        "legendOption": {
          "maxContent": 30,
          "actionMode": "toggle",
          "sortOrder": "none",
          "show": true,
          "position": "bottom"
        },
        "barOptions": {
          "barWidth": 0.9,
          "orientation": "vertical",
          "showValues": "auto",
          "fillOpacity": 85,
          "stackingMode": "none",
          "valueSize": 12,
          "groupWidth": 0.7,
          "labelLocation": "xAxis",
          "gradientMode": "none",
          "lineWidth": 1
        },
        "basicOptions": {
          "displayName": "拒绝 QPS",
          "showTitle": true,
          "showBackground": true,
          "showTime": true,
          "showBorder": true
        },
        "graphOptions": {
          "pointSize": 6,
          "fillOpacity": 40,
          "showPoint": "none",
          "lineInterpolation": "smooth",
          "barStyle": "middle",
          "gradientMode": "opacity",
          "lineWidth": 1.5,
          "seriesStyle": "lines"
        },
        "innerTokenOption": [],
        "documentLinkOption": {
          "showIcon": true,
          "documentLinks": []
        },
        "height": 8
      },
      "action": {},
      "title": "metrics-blocked",
      "type": "aggpro"
    },
    {
      "search": {
        "query": "@",
        "start": "-900s",
        "topic": "",
        "end": "now",
        "chartQueries": [
          {
            "datasource": "logstore",
            "query": "* | select sum(exception_qps) as exception_qps, resource_name as groupBy, timestamp group by resource_name, timestamp order by timestamp limit 100000",
            "name": "A",
            "tokenQuery": "* | select sum(exception_qps) as exception_qps, ${{groupby|resource_name}} as groupBy, timestamp group by ${{groupby|resource_name}}, timestamp order by timestamp limit 100000",
            "project": "{project_name}",
            "logstore": "{logstore_name}"
          }
        ],
        "logstore": "@",
        "dataSourceType": "current"
      },
      "display": {
        "queryOptionMap": {
          "A": {
            "yAxisKey": "exception_qps",
            "xAxisKey": "timestamp",
            "name": "A",
            "aggField": "groupBy"
          }
        },
        "yPos": 20,
        "standardOption": {
          "unit": {
            "unit": "none"
          },
          "format": "none"
        },
        "displayName": "",
        "yAxisOption": {
          "stackingMode": "none",
          "show": true,
          "position": 3
        },
        "tooltipOption": {
          "mode": "all",
          "labelFormat": "",
          "sortOrder": "none"
        },
        "xAxisOption": {
          "timeRangeMode": "dataTime",
          "format": {
            "value": "auto"
          },
          "show": true,
          "zoomTarget": "global"
        },
        "xPos": 0,
        "actionOptions": [],
        "dataOption": {
          "autoFill": false,
          "maxClassifyGroupNum": 50,
          "autoFillNumber": 0
        },
        "version": "2",
        "isTimeSeries": true,
        "thresholdOption": {
          "fillOpacity": 40
        },
        "aggChartOption": {
          "chartType": "line"
        },
        "width": 12,
        "legendOption": {
          "maxContent": 30,
          "actionMode": "toggle",
          "sortOrder": "none",
          "show": true,
          "position": "bottom"
        },
        "barOptions": {
          "barWidth": 0.9,
          "orientation": "vertical",
          "showValues": "auto",
          "fillOpacity": 85,
          "stackingMode": "none",
          "valueSize": 12,
          "groupWidth": 0.7,
          "labelLocation": "xAxis",
          "gradientMode": "none",
          "lineWidth": 1
        },
        "basicOptions": {
          "displayName": "异常 QPS",
          "showTitle": true,
          "showBackground": true,
          "showTime": true,
          "showBorder": true
        },
        "graphOptions": {
          "pointSize": 6,
          "fillOpacity": 40,
          "showPoint": "none",
          "lineInterpolation": "smooth",
          "barStyle": "middle",
          "gradientMode": "opacity",
          "lineWidth": 1.5,
          "seriesStyle": "lines"
        },
        "innerTokenOption": [],
        "documentLinkOption": {
          "showIcon": true,
          "documentLinks": []
        },
        "height": 8
      },
      "action": {},
      "title": "metrics-exception",
      "type": "aggpro"
    },
    {
      "search": {
        "query": "@",
        "start": "-900s",
        "topic": "",
        "end": "now",
        "chartQueries": [
          {
            "datasource": "logstore",
            "query": "* | select sum(completed_qps) as completed_qps, resource_name as groupBy, timestamp group by resource_name, timestamp order by timestamp limit 100000",
            "name": "A",
            "tokenQuery": "* | select sum(completed_qps) as completed_qps, ${{groupby|resource_name}} as groupBy, timestamp group by ${{groupby|resource_name}}, timestamp order by timestamp limit 100000",
            "project": "{project_name}",
            "logstore": "{logstore_name}"
          }
        ],
        "logstore": "@",
        "dataSourceType": "current"
      },
      "display": {
        "queryOptionMap": {
          "A": {
            "yAxisKey": "completed_qps",
            "xAxisKey": "timestamp",
            "name": "A",
            "aggField": "groupBy"
          }
        },
        "yPos": 20,
        "standardOption": {
          "unit": {
            "unit": "none"
          },
          "format": "none"
        },
        "displayName": "",
        "yAxisOption": {
          "stackingMode": "none",
          "show": true,
          "position": 3
        },
        "tooltipOption": {
          "mode": "all",
          "labelFormat": "",
          "sortOrder": "none"
        },
        "xAxisOption": {
          "timeRangeMode": "dataTime",
          "format": {
            "value": "auto"
          },
          "show": true,
          "zoomTarget": "global"
        },
        "xPos": 12,
        "actionOptions": [],
        "dataOption": {
          "autoFill": false,
          "maxClassifyGroupNum": 50,
          "autoFillNumber": 0
        },
        "version": "2",
        "isTimeSeries": true,
        "thresholdOption": {
          "fillOpacity": 40
        },
        "aggChartOption": {
          "chartType": "line"
        },
        "width": 12,
        "legendOption": {
          "maxContent": 30,
          "actionMode": "toggle",
          "sortOrder": "none",
          "show": true,
          "position": "bottom"
        },
        "barOptions": {
          "barWidth": 0.9,
          "orientation": "vertical",
          "showValues": "auto",
          "fillOpacity": 85,
          "stackingMode": "none",
          "valueSize": 12,
          "groupWidth": 0.7,
          "labelLocation": "xAxis",
          "gradientMode": "none",
          "lineWidth": 1
        },
        "basicOptions": {
          "displayName": "完成 QPS",
          "showTitle": true,
          "showBackground": true,
          "showTime": true,
          "showBorder": true
        },
        "graphOptions": {
          "pointSize": 6,
          "fillOpacity": 40,
          "showPoint": "none",
          "lineInterpolation": "smooth",
          "barStyle": "middle",
          "gradientMode": "opacity",
          "lineWidth": 1.5,
          "seriesStyle": "lines"
        },
        "innerTokenOption": [],
        "documentLinkOption": {
          "showIcon": true,
          "documentLinks": []
        },
        "height": 8
      },
      "action": {},
      "title": "metrics-completed",
      "type": "aggpro"
    },
    {
      "search": {
        "query": "@",
        "start": "-900s",
        "topic": "",
        "end": "now",
        "chartQueries": [
          {
            "datasource": "logstore",
            "query": "* | select sum(concurrency) as concurrency, resource_name as groupBy, timestamp group by resource_name, timestamp order by timestamp limit 100000",
            "name": "A",
            "tokenQuery": "* | select sum(concurrency) as concurrency, ${{groupby|resource_name}} as groupBy, timestamp group by ${{groupby|resource_name}}, timestamp order by timestamp limit 100000",
            "project": "{project_name}",
            "logstore": "{logstore_name}"
          }
        ],
        "logstore": "@",
        "dataSourceType": "current"
      },
      "display": {
        "queryOptionMap": {
          "A": {
            "yAxisKey": "concurrency",
            "xAxisKey": "timestamp",
            "name": "A",
            "aggField": "groupBy"
          }
        },
        "yPos": 28,
        "standardOption": {
          "unit": {
            "unit": "none"
          },
          "format": "none"
        },
        "displayName": "",
        "yAxisOption": {
          "stackingMode": "none",
          "show": true,
          "position": 3
        },
        "tooltipOption": {
          "mode": "all",
          "labelFormat": "",
          "sortOrder": "none"
        },
        "xAxisOption": {
          "timeRangeMode": "dataTime",
          "format": {
            "value": "auto"
          },
          "show": true,
          "zoomTarget": "global"
        },
        "xPos": 0,
        "actionOptions": [],
        "dataOption": {
          "autoFill": false,
          "maxClassifyGroupNum": 50,
          "autoFillNumber": 0
        },
        "version": "2",
        "isTimeSeries": true,
        "thresholdOption": {
          "fillOpacity": 40
        },
        "aggChartOption": {
          "chartType": "line"
        },
        "width": 12,
        "legendOption": {
          "maxContent": 30,
          "actionMode": "toggle",
          "sortOrder": "none",
          "show": true,
          "position": "bottom"
        },
        "barOptions": {
          "barWidth": 0.9,
          "orientation": "vertical",
          "showValues": "auto",
          "fillOpacity": 85,
          "stackingMode": "none",
          "valueSize": 12,
          "groupWidth": 0.7,
          "labelLocation": "xAxis",
          "gradientMode": "none",
          "lineWidth": 1
        },
        "basicOptions": {
          "displayName": "并发",
          "showTitle": true,
          "showBackground": true,
          "showTime": true,
          "showBorder": true
        },
        "graphOptions": {
          "pointSize": 6,
          "fillOpacity": 40,
          "showPoint": "none",
          "lineInterpolation": "smooth",
          "barStyle": "middle",
          "gradientMode": "opacity",
          "lineWidth": 1.5,
          "seriesStyle": "lines"
        },
        "innerTokenOption": [],
        "documentLinkOption": {
          "showIcon": true,
          "documentLinks": []
        },
        "height": 8
      },
      "action": {},
      "title": "metrics-concurrency",
      "type": "aggpro"
    },
    {
      "search": {
        "query": "@",
        "start": "-900s",
        "topic": "",
        "end": "now",
        "chartQueries": [
          {
            "datasource": "logstore",
            "query": "* | select sum(avg_rt*passed_qps)/sum(passed_qps) as avg_rt, resource_name as groupBy, timestamp group by resource_name, timestamp order by timestamp limit 100000",
            "name": "A",
            "tokenQuery": "* | select sum(avg_rt*passed_qps)/sum(passed_qps) as avg_rt, ${{groupby|resource_name}} as groupBy, timestamp group by ${{groupby|resource_name}}, timestamp order by timestamp limit 100000",
            "project": "{project_name}",
            "logstore": "{logstore_name}"
          }
        ],
        "logstore": "@",
        "dataSourceType": "current"
      },
      "display": {
        "queryOptionMap": {
          "A": {
            "yAxisKey": "avg_rt",
            "xAxisKey": "timestamp",
            "name": "A",
            "aggField": "groupBy"
          }
        },
        "yPos": 28,
        "standardOption": {
          "unit": {
            "unit": "none"
          },
          "format": "none"
        },
        "displayName": "",
        "yAxisOption": {
          "stackingMode": "none",
          "show": true,
          "position": 3
        },
        "tooltipOption": {
          "mode": "all",
          "labelFormat": "",
          "sortOrder": "none"
        },
        "xAxisOption": {
          "timeRangeMode": "dataTime",
          "format": {
            "value": "auto"
          },
          "show": true,
          "zoomTarget": "global"
        },
        "xPos": 12,
        "actionOptions": [],
        "dataOption": {
          "autoFill": false,
          "maxClassifyGroupNum": 50,
          "autoFillNumber": 0
        },
        "version": "2",
        "isTimeSeries": true,
        "thresholdOption": {
          "fillOpacity": 40
        },
        "aggChartOption": {
          "chartType": "line"
        },
        "width": 12,
        "legendOption": {
          "maxContent": 30,
          "actionMode": "toggle",
          "sortOrder": "none",
          "show": true,
          "position": "bottom"
        },
        "barOptions": {
          "barWidth": 0.9,
          "orientation": "vertical",
          "showValues": "auto",
          "fillOpacity": 85,
          "stackingMode": "none",
          "valueSize": 12,
          "groupWidth": 0.7,
          "labelLocation": "xAxis",
          "gradientMode": "none",
          "lineWidth": 1
        },
        "basicOptions": {
          "displayName": "平均 RT",
          "showTitle": true,
          "showBackground": true,
          "showTime": true,
          "showBorder": true
        },
        "graphOptions": {
          "pointSize": 6,
          "fillOpacity": 40,
          "showPoint": "none",
          "lineInterpolation": "smooth",
          "barStyle": "middle",
          "gradientMode": "opacity",
          "lineWidth": 1.5,
          "seriesStyle": "lines"
        },
        "innerTokenOption": [],
        "documentLinkOption": {
          "showIcon": true,
          "documentLinks": []
        },
        "height": 8
      },
      "action": {},
      "title": "metrics-avgrt",
      "type": "aggpro"
    }
  ]
}
  • 本页导读 (1)
  • 前提条件
  • 开启日志采集组件
  • 接入数据
  • 日志上报验证
  • 构建图表
  • 概览
  • 详情