Skip to content

Commit

Permalink
对于过长埋点,记录内容长度和数据类型
Browse files Browse the repository at this point in the history
  • Loading branch information
nnhy committed Nov 19, 2023
1 parent 2118574 commit 19b1e14
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions NewLife.CubeNC/WebMiddleware/TracerMiddleware.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ public async Task Invoke(HttpContext ctx)
span.Tag = Environment.NewLine + buf.ToStr(null, 0, count);
req.Body.Position = 0;
}
else
{
span.AppendTag($"ContentLength: {req.ContentLength}");
span.AppendTag($"ContentType: {req.ContentType}");
}

if (span.Tag.Length < 500)
{
Expand Down

0 comments on commit 19b1e14

Please sign in to comment.