diff --git a/pkg/serverless/appsec/httpsec/proxy.go b/pkg/serverless/appsec/httpsec/proxy.go index 9f60ab9b6525b5..7ee8e0c5b54481 100644 --- a/pkg/serverless/appsec/httpsec/proxy.go +++ b/pkg/serverless/appsec/httpsec/proxy.go @@ -237,7 +237,7 @@ func (lp *ProxyLifecycleProcessor) spanModifier(lastReqId string, chunk *pb.Trac log.Debug("appsec: missing span tag http.status_code") } - if res := lp.appsec.Monitor(ctx.toAddresses()); len(res.Events) > 0 { + if res := lp.appsec.Monitor(ctx.toAddresses()); res.HasEvents() { setSecurityEventsTags(span, res.Events, reqHeaders, nil) chunk.Priority = int32(sampler.PriorityUserKeep)