Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Monitoring QUIC/HTTP3 read and written bytes #84093

Open
ladeak opened this issue Mar 29, 2023 · 8 comments
Open

Monitoring QUIC/HTTP3 read and written bytes #84093

ladeak opened this issue Mar 29, 2023 · 8 comments
Labels
area-System.Net.Quic help wanted [up-for-grabs] Good issue for external contributors
Milestone

Comments

@ladeak
Copy link
Contributor

ladeak commented Mar 29, 2023

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 #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 #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

@ladeak ladeak added the api-suggestion Early API idea and discussion, it is NOT ready for implementation label Mar 29, 2023
@ghost ghost added the untriaged New issue has not been triaged by the area owner label Mar 29, 2023
@ghost
Copy link

ghost commented Mar 29, 2023

Tagging subscribers to this area: @dotnet/ncl
See info in area-owners.md if you want to be subscribed.

Issue Details

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 #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 #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.

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

Author: ladeak
Assignees: -
Labels:

api-suggestion, area-System.Net.Http

Milestone: -

@ManickaP
Copy link
Member

Are you interested in HTTP payload size or bytes received on QUIC level? HTTP/3 has its own framing, which would count as part of QUIC bytes, but wouldn't count into actual HTTP payload bytes.

@ladeak
Copy link
Contributor Author

ladeak commented Mar 31, 2023

I would be interested in the Quic bytes which includes the H3 frames.

@ladeak
Copy link
Contributor Author

ladeak commented Apr 4, 2023

@ManickaP or @karelz do you have any suggestions?

@ghost
Copy link

ghost commented Apr 6, 2023

Tagging subscribers to this area: @dotnet/ncl
See info in area-owners.md if you want to be subscribed.

Issue Details

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 #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 #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

Author: ladeak
Assignees: -
Labels:

api-suggestion, untriaged, area-System.Net.Quic

Milestone: -

@CarnaViire CarnaViire removed the api-suggestion Early API idea and discussion, it is NOT ready for implementation label Apr 6, 2023
@CarnaViire CarnaViire changed the title [API Proposal]: Monitoring HTTP3 read and written bytes Monitoring QUIC/HTTP3 read and written bytes Apr 6, 2023
@ManickaP
Copy link
Member

At the moment, no suggestions. This will need change in production code. If you were the one calling Quic, you'd now the amount of bytes. If you were interested in H/3 bytes, then this would be nice suggestion for HTTP telemetry. But this is neither, so I'm inclined to push this to future.

If you really need this, we would take a contribution for 8.0. And if you'd be willing to do this, please let us know and talk about potential solutions before diving into implementation.

@ManickaP ManickaP removed the untriaged New issue has not been triaged by the area owner label Apr 12, 2023
@ManickaP ManickaP added this to the Future milestone Apr 12, 2023
@ManickaP ManickaP added the help wanted [up-for-grabs] Good issue for external contributors label Apr 12, 2023
@ladeak
Copy link
Contributor Author

ladeak commented Apr 12, 2023

I am busy in the coming weeks, but I can return here in the summer and discuss potential solutions before contributing.

@ManickaP
Copy link
Member

Awesome, thanks!
Just FYI, we have a feature freeze in the first half of July, so your potential change might end up in .NET 9.0 instead of 8.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-System.Net.Quic help wanted [up-for-grabs] Good issue for external contributors
Projects
None yet
Development

No branches or pull requests

3 participants