From fe3173bc0b1abdb7c73346d20347645cafd74bea Mon Sep 17 00:00:00 2001 From: GoEdgeLab Date: Mon, 26 Jul 2021 16:50:34 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=86=85=E7=BD=AE=E7=BB=9F?= =?UTF-8?q?=E8=AE=A1=E6=8C=87=E6=A0=87=EF=BC=9A=E8=AF=B7=E6=B1=82=E6=9D=A5?= =?UTF-8?q?=E6=BA=90=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/setup/sql_executor.go | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/internal/setup/sql_executor.go b/internal/setup/sql_executor.go index fbfb9a0c..be3c1e4c 100644 --- a/internal/setup/sql_executor.go +++ b/internal/setup/sql_executor.go @@ -20,7 +20,7 @@ import ( var LatestSQLResult = &SQLDumpResult{} -// 安装或升级SQL执行器 +// SQLExecutor 安装或升级SQL执行器 type SQLExecutor struct { dbConfig *dbs.DBConfig } @@ -379,6 +379,20 @@ func (this *SQLExecutor) checkMetricItems(db *dbs.DB) error { } } + { + err := createMetricItem("request_referer_host", serverconfigs.MetricItemCategoryHTTP, "请求来源统计", []string{"${referer.host}"}, 1, "day", "${countRequest}", []maps.Map{ + { + "name": "请求来源排行", + "type": "bar", + "widthDiv": 0, + "code": "request_referer_host_bar", + }, + }) + if err != nil { + return err + } + } + return nil }