quinn-rs / quinn

Async-friendly QUIC implementation in Rust
Apache License 2.0
3.6k stars 368 forks source link

Generate qlog traces #406

Open Ralith opened 4 years ago

Ralith commented 4 years ago

qlog is a draft standard for encoding protocol event traces. It might be useful for Quinn to have conditionally compiled support for generating qlog traces to debug complex behavior using qlog-oriented tooling.

stammw commented 4 years ago

Adding an interop tag here because qlog generation is part of the interop listed test under L.

There is an existing qlog implementation that we could integrate.

djc commented 4 years ago

That would make sense, I think!

Ralith commented 4 years ago

Awesome find! That'll make this a lot easier.

euberdeveloper commented 2 years ago

Any news on this?

Ralith commented 2 years ago

Nobody's taken it on yet.

kixelated commented 9 months ago

I'll implement this eventually. qlog was instrumental for debugging and diagnosing congestion control in my (closed source) QUIC implementation.

qlog traces are MASSIVE even with gzip, which also uses a lot of CPU. You would need the ability to enable qlog on a per-connection basis, and it has to be done early so you don't drop those initial events.

I was thinking:

/// Enable logging for events that could not be associated with a connection (ex. unknown packets)
Endpoint::enable_qlog(w: AsyncWrite)

/// Enable logging for all events associated with this connection
Connecting::enable_qlog(w: AsyncWrite)

Most of the events will be emitted inside a Mutex and a a blocking filesystem write would be devastating. AsyncWrite is used mostly so the compiler would catch those.

A filter would also be cool, as most qlog events/fields are optional and some are very verbose. For example, you can emit base64 encoded packet/steam contents with the raw field, but that's extremely situational. It's not as simple as a verbosity level because the most verbose events are often unrelated.

Ralith commented 9 months ago

Note qvis reportedly does not plan to implement qlog 0.4; they're sticking with 0.3 until a 1.0 RC is specced.

You would need the ability to enable qlog on a per-connection basis

I'm not sure about this. I'd imagine usually you're either spinning up an endpoint purely for testing, or don't want qlog at all.

marcblanchet commented 8 months ago

support. very useful for interop and special uses. would love to get