Skip to content

http2: add header map stats histograms#45479

Merged
yanavlasov merged 3 commits into
envoyproxy:mainfrom
yanavlasov:header-size-histograms
Jun 10, 2026
Merged

http2: add header map stats histograms#45479
yanavlasov merged 3 commits into
envoyproxy:mainfrom
yanavlasov:header-size-histograms

Conversation

@yanavlasov

@yanavlasov yanavlasov commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Add histograms for HTTP/2 header map stats.

  • header_count - total count of header entries received (including individual cookie headers)
  • header_list_size - total byte size of header map entries, total length of the re-assembled cookie
  • cookie_count - count of individual cookie headers.
  • cookie_size - size of re-assembled cookie headers.

Histograms are disabled by default and can be enabled by
setting the runtime guard envoy.reloadable_features.http2_record_histograms to true.

Risk Level: low
Testing: unit tests
Docs Changes: yes
Release Notes: yes
Platform Specific Features: no
Runtime guard: envoy.reloadable_features.http2_record_histograms

@repokitteh-read-only

Copy link
Copy Markdown

CC @envoyproxy/runtime-guard-changes: FYI only for changes made to (source/common/runtime/runtime_features.cc).

🐱

Caused by: #45479 was opened by yanavlasov.

see: more, trace.

@yanavlasov
yanavlasov enabled auto-merge (squash) June 5, 2026 18:42
Signed-off-by: Yan Avlasov <[email protected]>
@yanavlasov
yanavlasov disabled auto-merge June 5, 2026 19:42
@yanavlasov
yanavlasov enabled auto-merge (squash) June 5, 2026 19:42
if (stream) {
const int32_t stream_id = stream->stream_id_;

recordHistogramsForStream(*stream);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we want to record zero values for those histograms when stream is closed and headers have not been received yet (could skew the data)? we could add a check here if any headers have been received.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is probably ok, since the more interesting data is the maximum values.

wbpcode
wbpcode previously approved these changes Jun 9, 2026

@wbpcode wbpcode left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

histogram is not cheap. do we actually need this or actually access log could provide the same observability?

@wbpcode wbpcode left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

histogram is not cheap. do we actually need this or actually access log could provide the same observability?

@yanavlasov

Copy link
Copy Markdown
Contributor Author

histogram is not cheap. do we actually need this or actually access log could provide the same observability?

I do not think we have this data for the access log. The histogram is disabled by default and is an aid for users who need to tune cookie sizes. This will be removed once we have determined good limits on the H/2 cookie headers.

@yanavlasov
yanavlasov merged commit 8b9314e into envoyproxy:main Jun 10, 2026
28 checks passed
@yanavlasov
yanavlasov deleted the header-size-histograms branch June 10, 2026 00:54
phlax pushed a commit that referenced this pull request Jun 10, 2026
Add histograms for HTTP/2 header map stats.

* header_count - total count of header entries received (including
individual ``cookie`` headers)
* header_list_size - total byte size of header map entries, total length
of the re-assembled ``cookie``
* cookie_count - count of individual ``cookie`` headers.
* cookie_size - size of re-assembled ``cookie`` headers.

Histograms are disabled by default and can be enabled by
setting the runtime guard
``envoy.reloadable_features.http2_record_histograms`` to ``true``.

Risk Level: low
Testing: unit tests
Docs Changes: yes
Release Notes: yes
Platform Specific Features: no
Runtime guard: envoy.reloadable_features.http2_record_histograms

---------

Signed-off-by: Yan Avlasov <[email protected]>
nezdolik pushed a commit that referenced this pull request Jun 10, 2026
Add histograms for HTTP/2 header map stats.

* header_count - total count of header entries received (including
individual ``cookie`` headers)
* header_list_size - total byte size of header map entries, total length
of the re-assembled ``cookie``
* cookie_count - count of individual ``cookie`` headers.
* cookie_size - size of re-assembled ``cookie`` headers.

Histograms are disabled by default and can be enabled by
setting the runtime guard
``envoy.reloadable_features.http2_record_histograms`` to ``true``.

Risk Level: low
Testing: unit tests
Docs Changes: yes
Release Notes: yes
Platform Specific Features: no
Runtime guard: envoy.reloadable_features.http2_record_histograms

---------

Signed-off-by: Yan Avlasov <[email protected]>
nezdolik pushed a commit that referenced this pull request Jun 10, 2026
Add histograms for HTTP/2 header map stats.

* header_count - total count of header entries received (including
individual ``cookie`` headers)
* header_list_size - total byte size of header map entries, total length
of the re-assembled ``cookie``
* cookie_count - count of individual ``cookie`` headers.
* cookie_size - size of re-assembled ``cookie`` headers.

Histograms are disabled by default and can be enabled by
setting the runtime guard
``envoy.reloadable_features.http2_record_histograms`` to ``true``.

Risk Level: low
Testing: unit tests
Docs Changes: yes
Release Notes: yes
Platform Specific Features: no
Runtime guard: envoy.reloadable_features.http2_record_histograms

---------

Signed-off-by: Yan Avlasov <[email protected]>
phlax pushed a commit that referenced this pull request Jun 10, 2026
Add histograms for HTTP/2 header map stats.

* header_count - total count of header entries received (including
individual ``cookie`` headers)
* header_list_size - total byte size of header map entries, total length
of the re-assembled ``cookie``
* cookie_count - count of individual ``cookie`` headers.
* cookie_size - size of re-assembled ``cookie`` headers.

Histograms are disabled by default and can be enabled by
setting the runtime guard
``envoy.reloadable_features.http2_record_histograms`` to ``true``.

Risk Level: low
Testing: unit tests
Docs Changes: yes
Release Notes: yes
Platform Specific Features: no
Runtime guard: envoy.reloadable_features.http2_record_histograms

---------

Signed-off-by: Yan Avlasov <[email protected]>
nezdolik pushed a commit to nezdolik/envoy that referenced this pull request Jun 16, 2026
Add histograms for HTTP/2 header map stats.

* header_count - total count of header entries received (including
individual ``cookie`` headers)
* header_list_size - total byte size of header map entries, total length
of the re-assembled ``cookie``
* cookie_count - count of individual ``cookie`` headers.
* cookie_size - size of re-assembled ``cookie`` headers.

Histograms are disabled by default and can be enabled by
setting the runtime guard
``envoy.reloadable_features.http2_record_histograms`` to ``true``.

Risk Level: low
Testing: unit tests
Docs Changes: yes
Release Notes: yes
Platform Specific Features: no
Runtime guard: envoy.reloadable_features.http2_record_histograms

---------

Signed-off-by: Yan Avlasov <[email protected]>
yanavlasov added a commit to yanavlasov/envoy that referenced this pull request Jul 6, 2026
Add histograms for HTTP/2 header map stats.

* header_count - total count of header entries received (including
individual ``cookie`` headers)
* header_list_size - total byte size of header map entries, total length
of the re-assembled ``cookie``
* cookie_count - count of individual ``cookie`` headers.
* cookie_size - size of re-assembled ``cookie`` headers.

Histograms are disabled by default and can be enabled by
setting the runtime guard
``envoy.reloadable_features.http2_record_histograms`` to ``true``.

Risk Level: low
Testing: unit tests
Docs Changes: yes
Release Notes: yes
Platform Specific Features: no
Runtime guard: envoy.reloadable_features.http2_record_histograms

---------

Signed-off-by: Yan Avlasov <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants