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
Copy file name to clipboardExpand all lines: instrumentation/opentelemetry-instrumentation-pyramid/src/opentelemetry/instrumentation/pyramid/__init__.py
+63-23
Original file line number
Diff line number
Diff line change
@@ -55,7 +55,7 @@
55
55
---------------------------------
56
56
57
57
If you use Method 2 and then set tweens for your application with the ``pyramid.tweens`` setting,
58
-
you need to add ``opentelemetry.instrumentation.pyramid.trace_tween_factory`` explicitly to the list,
58
+
you need to explicitly add ``opentelemetry.instrumentation.pyramid.trace_tween_factory`` to the list,
59
59
*as well as* instrumenting the config as shown above.
60
60
61
61
For example:
@@ -79,8 +79,9 @@
79
79
80
80
Exclude lists
81
81
*************
82
-
To exclude certain URLs from being tracked, set the environment variable ``OTEL_PYTHON_PYRAMID_EXCLUDED_URLS``
83
-
(or ``OTEL_PYTHON_EXCLUDED_URLS`` as fallback) with comma delimited regexes representing which URLs to exclude.
82
+
To exclude certain URLs from tracking, set the environment variable ``OTEL_PYTHON_PYRAMID_EXCLUDED_URLS``
83
+
(or ``OTEL_PYTHON_EXCLUDED_URLS`` to cover all instrumentations) to a string of comma delimited regexes that match the
84
+
URLs.
84
85
85
86
For example,
86
87
@@ -92,54 +93,93 @@
92
93
93
94
Capture HTTP request and response headers
94
95
*****************************************
95
-
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>`_.
96
+
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``
100
-
to a comma-separated list of HTTP header names.
101
+
To capture HTTP request headers as span attributes, set the environment variable
102
+
``OTEL_INSTRUMENTATION_HTTP_CAPTURE_HEADERS_SERVER_REQUEST`` to a comma delimited list of HTTP header names.
Would match all request headers that start with ``Accept`` and ``X-``.
109
120
110
-
It is recommended that you should give the correct names of the headers to be captured in the environment variable.
111
-
Request header names in pyramid 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``.
121
+
To capture all request headers, set ``OTEL_INSTRUMENTATION_HTTP_CAPTURE_HEADERS_SERVER_REQUEST`` to ``".*"``.
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 _ ).
114
-
The value of the attribute will be single item list containing all the header values.
126
+
The name of the added span attribute will follow the format ``http.request.header.<header_name>`` where ``<header_name>``
127
+
is the normalized HTTP header name (lowercase, with ``-`` replaced by ``_``). The value of the attribute will be a
128
+
single item list containing all the header values.
To capture predefined HTTP response headers as span attributes, set the environment variable ``OTEL_INSTRUMENTATION_HTTP_CAPTURE_HEADERS_SERVER_RESPONSE``
122
-
to a comma-separated list of HTTP header names.
135
+
To capture HTTP response headers as span attributes, set the environment variable
136
+
``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-``.
131
154
132
-
It is recommended that you should give the correct names of the headers to be captured in the environment variable.
133
-
Response header names captured in pyramid are case insensitive. So, giving header name as ``CUStomHeader`` in environment variable will be able capture header with name ``customheader``.
155
+
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 _ ).
136
-
The value of the attribute will be single item list containing all the header values.
160
+
The name of the added span attribute will follow the format ``http.response.header.<header_name>`` where ``<header_name>``
161
+
is the normalized HTTP header name (lowercase, with ``-`` replaced by ``_``). The value of the attribute will be a
162
+
single item list containing all the header values.
0 commit comments