dotnet/runtime

Monitoring QUIC/HTTP3 read and written bytes

Open

#84.093 geöffnet am 29. März 2023

Auf GitHub ansehen
 (8 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)C# (5.445 Forks)batch import
area-System.Net.Quichelp wanted

Repository-Metriken

Stars
 (17.886 Stars)
PR-Merge-Metriken
 (Durchschn. Merge 12T 11h) (661 gemergte PRs in 30 T)

Beschreibung

Background and motivation

I am looking for a reasonable way to monitor traffic (number of bytes received) on HTTP requests including HTTP/3.

I found a previous issue https://github.com/dotnet/runtime/issues/41949 that allows to use a custom stream implementation for H2

However, I don't see that being viable for QuicConnetions and H3.

What I would prefer is something similar as described in https://github.com/dotnet/runtime/issues/31003 by @karelz using monitoring.

However, the ReadAsync only seems to monitor the size of the buffer where the data is read into, but not the actual size of the received data:

if (NetEventSource.Log.IsEnabled())
{
    NetEventSource.Info(this, $"{this} Stream reading into memory of '{buffer.Length}' bytes.");
}

Is there an alternative approach to access this data?

API Proposal

I would be happy to use EventListener to collect the described data.

Ideally the event payload could store the size of the data without formatting it to string message.

API Usage

No new public API would be required.

Alternative Designs

No response

Risks

No response

Contributor Guide