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

proxy: trace response body size and request header length #3421

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

AlexanderYastrebov
Copy link
Member

@AlexanderYastrebov AlexanderYastrebov commented Feb 26, 2025

Add response body size and request headers length rounded to the next power of two as proxy span tags.

The rounding is done to reduce cardinality of the tags and avoid introducing a new configuration parameter.

Since it is tricky to measure request header length in bytes it is calculated as the sum of lengths of header names and values.

Note that OpenTelemetry Semantic Conventions for HTTP Spans define the following related attributes:

@AlexanderYastrebov AlexanderYastrebov added the major moderate risk, for example new API, small filter changes that have no risk like refactoring or logs label Feb 26, 2025
@AlexanderYastrebov AlexanderYastrebov force-pushed the proxy/tracing-headers-length branch 2 times, most recently from 9ffea21 to 36bfbdc Compare February 26, 2025 14:33
Add response body size and request headers length rounded to the next power of two as proxy span tags.

The rounding is done to reduce cardinality of the tags and avoid
introducing new configuration parameter.

Since it is tricky to measure request header length in bytes it is
calculated as the sum of lengths of header names and values.

Note that OpenTelemetry [Semantic Conventions for HTTP Spans](https://opentelemetry.io/docs/specs/semconv/http/http-spans/)
define the following related attributes:
* experimental [http.response.body.size](https://opentelemetry.io/docs/specs/semconv/attributes-registry/http/#http-response-body-size) for body size in bytes
* stable [http.request.header.<key>](https://opentelemetry.io/docs/specs/semconv/attributes-registry/http/#http-request-header) for header value

Signed-off-by: Alexander Yastrebov <[email protected]>
@AlexanderYastrebov AlexanderYastrebov force-pushed the proxy/tracing-headers-length branch from 36bfbdc to 704c996 Compare February 26, 2025 14:35
@MustafaSaber
Copy link
Member

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
major moderate risk, for example new API, small filter changes that have no risk like refactoring or logs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants