h2
The h2 task parses 2-way HTTP2 streams. It consumes data from the
tlsplaintext or payload tasks.
Configuration options
Many of the h2 options are controls over timeouts and the size of buffers.
Knowing which options to change can be difficult. Here are a few options we
think are good to start with.
To control how many flows can concurrently be tracked, the most important option
is streamer_max_flows. If the number of flows exceeds this value, the oldest
flow will be evicted from the cache and you are likely to see more missing
headers.
The timeout of inactive flows is controlled by streamer_expire_flows. If you
have flows that will be inactive for longer than this value, you will start
seeing missing headers.
If responses are slow, you may want to increase round_tripper_max_age, so you
give more time for requests and responses to be reassembled into full round
trips.
Here is the full like of configuration options:
flower_max_flows-
default 100000The maximum number of flows tracked. When the limit is reached, the oldest flow is removed. The flower reassembles frames. This option limits the number of flows for which Frames can be reassembled concurrently. Uses LRU.For example:
flower_max_flows:10000 flower_expire_flows-
default 300sThe time after which a flow is removed from the cache, if no new chunks for flow are seen.For example:
flower_expire_flows:10s flower_expire_interval-
default 1sThe interval at which the cache is checked for expired flows.For example:
flower_expire_interval:10s streamer_max_flows-
default 100000The maximum number of flows tracked. When the limit is reached, the oldest flow is removed. Streamer reassembles streams in each flow. This option limits the number of flows for which streams can be reassembled concurrently. Uses LRU.For example:
streamer_max_flows:10000 streamer_max_streams_per_flow-
default 1000The maximum number of streams tracked per flow. When the limit is reached, the oldest stream is removed. Uses LRU.For example:
streamer_max_streams_per_flow:10000 streamer_max_frames_buffer-
default 1000The maximum number of frames buffered per flow while attempting to maintain stream ordering. The order of the streams depends on the stream ID, and affects the dynamic header table, which required a complete order flow of streams in order to be valid.For example:
streamer_max_frames_buffer:100 streamer_max_preflight_buffer-
default 1000The maximum number of frames buffered per new flow while attempting to discover the direction of the flow (which direction is client or server. Beyond this limit, if the direction could not be determined, the entire flow is dropped.For example:
streamer_max_preflight_buffer:1000 streamer_expire_flows-
default 300sThe time after which a flow is removed from the cache, if no new frames for flow are seen.For example:
streamer_expire_flows:10s streamer_expire_streams-
default 10sThe time after which a stream is removed from the cache, if no new frames for stream are seen.For example:
streamer_expire_streams:10s streamer_expire_terminated_streams-
default 2sThe time after which a terminated stream is removed from the cache, if no new frames for stream are seen. Terminated streams are streams that have been closed by a RST_STREAM or a GO_AWAY. This timeout is usually shorter thanstreamer_expire_streamsbecause terminated streams are not expected to receive any more frames. We do not expire them immediately on termination because we want to allow for a small window of time for any late frames to arrive.For example:
streamer_expire_terminated_streams:10s streamer_expire_interval-
default 1sThe interval at which the cache is checked for expired streams and flows.For example:
streamer_expire_interval:10s round_tripper_max_round_trips-
default 100000The maximum number of round trips tracked. When the limit is reached, the oldest round trip is removed. Uses LRU.For example:
round_tripper_max_round_trips:1000 round_tripper_rst_stream_cache_size-
default 1000The maximum number of RST_STREAM frames tracked. When the limit is reached, the oldest RST_STREAM frame is removed. Uses LRU.For example:
round_tripper_rst_stream_cache_size:100 round_tripper_go_away_cache_size-
default 10000The maximum number of GO_AWAY frames tracked. When the limit is reached, the oldest GO_AWAY frame is removed. Uses LRU.For example:
round_tripper_go_away_cache_size:1000 round_tripper_max_age-
default 20sThe time after which a round trip is removed from the cache, if no new components for round trip are seen.For example:
round_tripper_max_age:10s round_tripper_max_age_terminated-
default 5sThe time after which a terminated round trip is removed from the cache, if no new components for round trip are seen. Terminate round trips are round trips that have been closed by a RST_STREAM or a GO_AWAY. This timeout is usually shorter thanround_tripper_max_agebecause terminated round trips are not expected to receive any more components.For example:
round_tripper_max_age_terminated:10s round_tripper_check_age_interval-
default 1sThe interval at which the cache is checked for expired round trips.For example:
round_tripper_check_age_interval:10s round_tripper_disable_release_delay-
default falseDisable the full round trips release delay. Full round trips are round trips that received all their components. They are not released immediately, but after a delay, to allow for late RST_STREAM and GO_AWAY frames to be attached to the round trips. Set to true to disable this delay.For example:
round_tripper_disable_release_delay:true round_tripper_release_delay-
default 2sThe delay after which a full round trip is released. Seeround_tripper_disable_release_delayfor more details.For example:
round_tripper_release_delay:10s reorder-
default 0By default, theh2does not attempt to reorder incoming messages (default value of 0). The production of messages from thepayloadandtlsplaintexttasks can be out of order. This option will create a FIFO queue in front of theh2reassembly. Messages will only be released from the FIFO queues as new messages arrive, so processing will be delayed by the time it takes to fill up the queue. For example, if the reorder queue is of 100 messages, and messages are produced at a rate of 10 messages per second, the output ofh2will be delayed by 10 seconds.For example:
reorder:100 verbose-
default falseVerbose enables extra logging that will be output if the instance is set up with adebugortracelog level. This will produce substancially more logs (up to 2 logs per incoming message intrace) and is not recommended in production.For example:
verbose:true
Output
h2.roundtrip-
mapHolds the reassembled HTTP2 round trip. h2.roundtrip.flowID-
stringUnique identifier for the current bi-directional flow. h2.roundtrip.streamID-
stringUnique identifier for the current single round trip. h2.roundtrip.latency-
uintHolds the duration in nanoseconds of the round trip, from the first 'packet' of the request, to the last 'packet' of the response. This is produced using the high precision in-kernel timer (seeh2.roundtrip.(request|response).timing). h2.roundtrip.timing-
map - optionalHolds the userspace absolute timing of the round trip. This corresponds to the timing as captured when 'packets' reach the h2 task. h2.roundtrip.timing.from-
uintThe start time of the round trip capture, which is when we see the first 'packet' of the Request. h2.roundtrip.timing.to-
uintThe end time of the round trip capture, which is when we see the lasr 'packet' of the Response. h2.roundtrip.partial-
booleanPartialfalseindicates the complete round trip was captured without errors. There could still be missing headers due to an incomplete dynamic header table. Partialtrueindicates the full round trip was no reassembled, and a partial round trip was published due to a timeout (no frames for the given round trip were produced for the duration defined by the timeout) or all components of a round trip (request and response headers and bodies) were encountered but one or more of them could not be parsed. h2.roundtrip.request-
map - optionalHolds the HTTP2 Request. h2.roundtrip.request.timing-
map - optionalHolds the kernelspace relative timing of the request in nanoseconds. This corresponds to the timing as captured in the kernel with high resolution and high precision, but it is a relative time (from system boot time but stops during suspend). This is useful for relative timing, to calculate precise duration of a round trip. h2.roundtrip.request.timing.from-
uintThe start time of the round request, which is when we see the first 'packet' of the request. h2.roundtrip.request.timing.to-
uintThe end time of the round request, which is when we see the last 'packet' of the request. h2.roundtrip.request.header-
map - optionalHolds the HTTP2 Request Header. h2.roundtrip.request.header.method-
stringThe HTTP2 Method [pseudo header](https://httpwg.org/specs/rfc9113.html#HttpRequest) (such as"GET","POST"…). h2.roundtrip.request.header.path-
stringThe HTTP2 Path pseudo header (e.g."/path/here"). h2.roundtrip.request.header.authority-
stringThe HTTP2 Authority pseudo header (a.k.a. the target host[:port]). h2.roundtrip.request.header.scheme-
stringThe HTTP2 Scheme pseudo header ("http"or"https"). h2.roundtrip.request.headers-
mapHolds the remaining non-pseudo headers. h2.roundtrip.request.headers.fields-
map - optionalHolds the remaining headers name-value pairs, where the name is the normalized (lowercase) header key, and the value is an array of strings for the given key. h2.roundtrip.request.headers.unknown-
int - optionalThis is the number of headers that could not be parsed due to an incomplete dynamic header table. h2.roundtrip.request.headers.valsMissingKey-
string array - optionalThese are header values for which the header name is unknown due to an incomplete dynamic header table. h2.roundtrip.request.headers.errors-
string array - optionalThis will contain errors encountered while parsing the header. h2.roundtrip.request.body-
map - optionalHolds the HTTP2 Request Body. h2.roundtrip.request.body.multipart-
booleanIs true if the body is a [multipart message](https://en.wikipedia.org/wiki/MIME#Multipart_messages). h2.roundtrip.request.body.parts-
map arrayThis will contains the parts of the body payload. If the body is not a multipart message, there will only be 1 part. h2.roundtrip.request.body.parts.contentType-
stringThe mime type of the part/body. h2.roundtrip.request.body.parts.guessed-
boolGuessed indicates whether the Content-Type of the part was guessed. This can happen if the Content-Type header is missing due to an incomplete dynamic header table. Only non-multipart body can be guessed: by definition, if the body is recognized as multipart, the Content-Type was present. The guess can be wrong in the case the data can be parsed as JSON but is not actually JSON (e.g. a body of3is valid JSON). h2.roundtrip.request.body.parts.jsonPayload-
json - optionalThis will contain the parsed JSON part/body, if the part/body was recognized as JSON, either by the Content-Type field or through testing whether the data was valid JSON. The format of this field is unknown, it can be any valid JSON, including object, array, string, number, bool or null. This field is exclusive with the binPayload field, only one of them should be available. h2.roundtrip.request.body.parts.binPayload-
string - optionalThis will contain the Base 64 representation of the part/body. This field is exclusive with the jsonPayload field, only one of them should be available. h2.roundtrip.response-
map - optionalHolds the HTTP2 Response. h2.roundtrip.response.timing-
map - optionalHolds the kernelspace relative timing of the response in nanoseconds. This corresponds to the timing as captured in the kernel with high resolution and high precision, but it is a relative time (from system boot time but stops during suspend). This is useful for relative timing, to calculate precise duration of a response. h2.roundtrip.response.timing.from-
uintThe start time of the response capture, which is when we see the first 'packet' of the response. h2.roundtrip.response.timing.to-
uintThe end time of the response capture, which is when we see the last 'packet' of the response. h2.roundtrip.response.header-
map - optionalHolds the HTTP2 Response Header. h2.roundtrip.response.header.status-
intThe HTTP2 Status code [pseudo header](https://httpwg.org/specs/rfc9113.html#rfc.section.8.3.2) (such as200,404…). h2.roundtrip.response.headers-
mapHolds the remaining non-pseudo headers. h2.roundtrip.response.headers.fields-
map - optionalHolds the remaining headers name-value pairs, where the name is the normalized (no capitals) header key, and the value is an array of strings for the given key. h2.roundtrip.response.headers.unknown-
int - optionalThis is the number of headers that could not be parsed due to an incomplete dynamic header table. h2.roundtrip.response.headers.valsMissingKey-
string array - optionalThese are header values for which the header name is unknown due to an incomplete dynamic header table. h2.roundtrip.response.headers.errors-
string array - optionalThis will contain errors encountered while parsing the header. h2.roundtrip.response.body-
map - optionalHolds the HTTP2 Response Body. h2.roundtrip.response.body.multipart-
booleanIs true if the body is a [multipart message](https://en.wikipedia.org/wiki/MIME#Multipart_messages). h2.roundtrip.response.body.parts-
map arrayThis will contains the parts of the body payload. If the body is not a multipart message, there will only be 1 part. h2.roundtrip.response.body.parts.contentType-
stringThe mime type of the part/body. h2.roundtrip.response.body.parts.guessed-
boolGuessed indicates whether the Content-Type of the part was guessed. This can happen if the Content-Type header is missing due to an incomplete dynamic header table. Only non-multipart body can be guessed: by definition, if the body is recognized as multipart, the Content-Type was present. The guess can be wrong in the case the data can be parsed as JSON but is not actually JSON (e.g. a body of3is valid JSON). h2.roundtrip.response.body.parts.jsonPayload-
json - optionalThis will contain the parsed JSON part/body, if the part/body was recognized as JSON, either by the Content-Type field or through testing whether the data was valid JSON. The format of this field is unknown, it can be any valid JSON, including object, array, string, number, bool or null. This field is exclusive with the binPayload field, only one of them should be available. h2.roundtrip.response.body.parts.binPayload-
string - optionalThis will contain the Base 64 representation of the part/body. This field is exclusive with the jsonPayload field, only one of them should be available. http2.net-
map - optionalHolds network connection information. http2.net.af-
mapLinux Address family. http2.net.proto-
mapL4 Protocol. http2.net.srcAddr-
mapSource address. http2.net.dstAddr-
mapDestination address. http2.net.srcPort-
mapSource Port. http2.net.dstPort-
mapDestination Port. http2.process-
mapHolds the Process information. http2.process.pid-
uint32Process PID. http2.process.ppid-
uint32Process Parent PID. http2.process.name-
stringProcess name. http2.process.cmd-
stringCommand line string. http2.process.exe-
stringExecutable name. http2.process.ns-
stringNamespace in the format of {device ID}-{inode number}. http2.process.startedAt-
stringTime the process started. http2.process.container-
mapContainer information for process (if it is a container). http2.process.container.ID-
stringID of Container. http2.process.container.Name-
stringName of Container.