dotnet / dotnet/aspnetcore

Ability to disable ConnectionId and RequestId + RequestPath scopes

Open
#31,028 10 comments 25 reactions 0 assignees View on GitHub
area-networking
Dominant language
C#
Stars
38.4k
Forks
10.9k
Avg merge
2d 10h
Merged PRs (30d)
281

Description

We use scopes to identify log entries as coming from a certain tenant, this is a critical part of our diagnostic ability.

Scopes have various performance downsides but due to the value they provide we really wouldn't want to disable them completely. We also add all scopes to our json logger going to cloud logging and the smaller these messages can be the better, there is a direct financial cost attached to ingestion of larger than need be messages over time.

However, and this is the issue, in the framework there exist a few scope pushes that have limited or no value for us and can't be turned off without also turning off important log messages.

`ConnectionId` is not relevant to us, but we can't turn it off because all of it is enabled under category `Microsoft.AspNetCore.Server.Kestrel` which also contains important log messages like reaching connection limits.

`RequestId` is really not relevant anymore (at least to us) with `SpanId` and `TraceId` being integrated by default but we can't turn it off
`RequestPath` is occasionaly useful but we could just as well emit it ourselves.

Our minimal scopes would ideally look like:
- Activity scope (implemented in https://github.com/dotnet/runtime/pull/37092)
- Our own scopes like tenantid, userid.

Would it be possible to provide knob(s) to disable these kestrel scopes somewhere, like in `KestrelServerOptions`? (not sure where RequestId + RequestPath comes from)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.