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 }