You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-`opentelemetry-instrumentation-system-metrics` add supports to collect system thread count. ([#1339](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1339))
18
18
-`opentelemetry-exporter-richconsole` Fixing RichConsoleExpoter to allow multiple traces, fixing duplicate spans and include resources ([#1336](https://github.com/open-telemetry/opentelemetry-python-contrib/pull/1336))
19
-
-`opentelemetry-instrumentation-asgi` Add support for regular expression matching of HTTP headers.
19
+
-`opentelemetry-instrumentation-asgi` Add support for regular expression matching and sanitization of HTTP headers.
You can configure the agent to capture predefined HTTP headers as span attributes, according to the `semantic convention <https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/semantic_conventions/http.md#http-request-and-response-headers>`_.
112
+
You can configure the agent to capture specified HTTP headers as span attributes, according to the
To capture predefined HTTP request headers as span attributes, set the environment variable ``OTEL_INSTRUMENTATION_HTTP_CAPTURE_HEADERS_SERVER_REQUEST``
110
-
to a comma-separated list of HTTP header names.
117
+
To capture HTTP request headers as span attributes, set the environment variable
118
+
``OTEL_INSTRUMENTATION_HTTP_CAPTURE_HEADERS_SERVER_REQUEST`` to a comma delimited list of HTTP header names.
will extract ``content-type`` and ``custom_request_header`` from request headers and add them as span attributes.
125
+
will extract ``content-type`` and ``custom_request_header`` from the request headers and add them as span attributes.
119
126
120
-
It is recommended that you should give the correct names of the headers to be captured in the environment variable.
121
-
Request header names in wsgi are case insensitive and - characters are replaced by _. So, giving header name as ``CUStom_Header`` in environment variable will be able capture header with name ``custom-header``.
127
+
Request header names in WSGI are case-insensitive and ``-`` characters are replaced by ``_``. So, giving the header
128
+
name as ``CUStom_Header`` in the environment variable will capture the header named ``custom-header``.
122
129
123
-
The name of the added span attribute will follow the format ``http.request.header.<header_name>`` where ``<header_name>`` being the normalized HTTP header name (lowercase, with - characters replaced by _ ).
124
-
The value of the attribute will be single item list containing all the header values.
130
+
Regular expressions may also be used to match multiple headers that correspond to the given pattern. For example:
To capture predefined HTTP response headers as span attributes, set the environment variable ``OTEL_INSTRUMENTATION_HTTP_CAPTURE_HEADERS_SERVER_RESPONSE``
132
-
to a comma-separated list of HTTP header names.
151
+
To capture HTTP response headers as span attributes, set the environment variable
152
+
``OTEL_INSTRUMENTATION_HTTP_CAPTURE_HEADERS_SERVER_RESPONSE`` to a comma delimited list of HTTP header names.
Would match all response headers that start with ``Content`` and ``X-``.
141
170
142
-
It is recommended that you should give the correct names of the headers to be captured in the environment variable.
143
-
Response header names captured in wsgi are case insensitive. So, giving header name as ``CUStomHeader`` in environment variable will be able capture header with name ``customheader``.
171
+
To capture all response headers, set ``OTEL_INSTRUMENTATION_HTTP_CAPTURE_HEADERS_SERVER_RESPONSE`` to ``".*"``.
The name of the added span attribute will follow the format ``http.response.header.<header_name>`` where ``<header_name>`` being the normalized HTTP header name (lowercase, with - characters replaced by _ ).
146
-
The value of the attribute will be single item list containing all the header values.
176
+
The name of the added span attribute will follow the format ``http.response.header.<header_name>`` where ``<header_name>``
177
+
is the normalized HTTP header name (lowercase, with ``-`` replaced by ``_``). The value of the attribute will be a
178
+
single item list containing all the header values.
"""Returns custom HTTP request headers which are configured by the user
294
342
from the PEP3333-conforming WSGI environ to be used as span creation attributes as described
295
343
in the specification https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/semantic_conventions/http.md#http-request-and-response-headers"""
0 commit comments