From 47860b1e4d3c5f64f9f993141503d94c9bf5d439 Mon Sep 17 00:00:00 2001 From: GoEdgeLab Date: Tue, 30 Apr 2024 00:05:32 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9C=A8=E8=AF=B7=E6=B1=82=E4=B8=8A=E4=B8=8B?= =?UTF-8?q?=E6=96=87=E4=B8=AD=E5=81=9C=E7=94=A8=E7=BB=9F=E8=AE=A1=E7=9A=84?= =?UTF-8?q?=E6=97=B6=E5=80=99=E4=B9=9F=E5=81=9C=E7=94=A8=E5=AF=B9=E5=BA=94?= =?UTF-8?q?=E7=9A=84=E6=8C=87=E6=A0=87=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/nodes/http_request.go | 4 +++- internal/nodes/http_request_waf.go | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/internal/nodes/http_request.go b/internal/nodes/http_request.go index ce9efc2..6331d37 100644 --- a/internal/nodes/http_request.go +++ b/internal/nodes/http_request.go @@ -103,6 +103,8 @@ type HTTPRequest struct { disableLog bool // 是否在当前请求中关闭Log forceLog bool // 是否强制记录日志 + disableMetrics bool // 不记录统计指标 + isHijacked bool // script相关操作 @@ -458,7 +460,7 @@ func (this *HTTPRequest) doEnd() { stats.SharedDAUManager.AddIP(this.ReqServer.Id, this.requestRemoteAddr(true)) // 指标 - if metrics.SharedManager.HasHTTPMetrics() { + if !this.disableMetrics && metrics.SharedManager.HasHTTPMetrics() { this.doMetricsResponse() } diff --git a/internal/nodes/http_request_waf.go b/internal/nodes/http_request_waf.go index 9c5206b..6c0e640 100644 --- a/internal/nodes/http_request_waf.go +++ b/internal/nodes/http_request_waf.go @@ -546,4 +546,6 @@ func (this *HTTPRequest) DisableStat() { if this.web != nil { this.web.StatRef = nil } + + this.disableMetrics = true }