BPF (kernel doc) backed request logging client for the H2O server.
Root privilege is required to interact with the BPF virtual machine.
The log line format is: ConnID ReqID HeaderName HeaderValue
, except the first line that represents the HTTP protocol version.
$ sudo h2olog -p $(pgrep -o h2o)
888 1 RxProtocol HTTP/2.0
888 1 RxHeader :authority torumk.com
888 1 RxHeader :method GET
888 1 RxHeader :path /
888 1 RxHeader :scheme https
888 1 TxStatus 200
... and more ...
- H2O server built after 53e1db42
- BCC (BPF Compiler Collection) installed on your system
- BCC v0.11.0 or later is required
- Root privilege to execute the program
Note that the bcc module on PyPi is unrelated to BPF.
Server-side QUIC events can be traced using the quic
subcommand.
Events are rendered in JSON format.
This feature is heavily a WIP.
$ sudo h2olog quic -p $(pgrep -o h2o)
^
|_ The quic subcommand
Here's an example trace.
{"at": 1580154303455, "type": "quicly:accept", "master_conn_id": 1, "dcid": "4070a82916f79d71"}
{"at": 1580154303457, "type": "quicly:packet_prepare", "master_conn_id": 1, "first_octet": 192, "dcid": "9e4605bc54ec8b9d"}
{"at": 1580154303457, "type": "quicly:packet_commit", "master_conn_id": 1, "packet_num": 0, "packet_len": 176, "ack_only": 0}
... and more ...
If you find the output to be too noisy, try using the -t
option to only trace a specific event type.
$ sudo h2olog quic -t quicly:accept -p $(pgrep -o h2o)
{"at": 1580410632750, "type": "quicly:accept", "master_conn_id": 2, "dcid": "cf53a37d6f47a005"}
{"at": 1580410633662, "type": "quicly:accept", "master_conn_id": 1, "dcid": "180c19519904013e"}
{"at": 1580410636950, "type": "quicly:accept", "master_conn_id": 2, "dcid": "8ccc04ffae33cc7b"}
{"at": 1580410637613, "type": "quicly:accept", "master_conn_id": 3, "dcid": "1f3b9363a583158b"}
h2olog is a BCC based single-file Python program (learn more). This might change in the future (e.g. switch to bpftrace), but the same CLI interface will be kept.
- Option for output filtering
- Option to redirect the output to a file