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-falcon/src/opentelemetry/instrumentation/falcon/__init__.py
+69-28Lines changed: 69 additions & 28 deletions
Original file line number
Diff line number
Diff line change
@@ -19,15 +19,16 @@
19
19
20
20
* The Falcon resource and method name is used as the Span name.
21
21
* The ``falcon.resource`` Span attribute is set so the matched resource.
22
-
* Error from Falcon resources are properly caught and recorded.
22
+
* Errors from Falcon resources are properly caught and recorded.
23
23
24
24
Configuration
25
25
-------------
26
26
27
27
Exclude lists
28
28
*************
29
-
To exclude certain URLs from being tracked, set the environment variable ``OTEL_PYTHON_FALCON_EXCLUDED_URLS``
30
-
(or ``OTEL_PYTHON_EXCLUDED_URLS`` as fallback) with comma delimited regexes representing which URLs to exclude.
29
+
To exclude certain URLs from tracking, set the environment variable ``OTEL_PYTHON_FALCON_EXCLUDED_URLS``
30
+
(or ``OTEL_PYTHON_EXCLUDED_URLS`` to cover all instrumentations) to a string of comma delimited regexes that match the
31
+
URLs.
31
32
32
33
For example,
33
34
@@ -39,16 +40,16 @@
39
40
40
41
Request attributes
41
42
********************
42
-
To extract certain attributes from Falcon's request object and use them as span attributes, set the environment variable ``OTEL_PYTHON_FALCON_TRACED_REQUEST_ATTRS`` to a comma
43
-
delimited list of request attribute names.
43
+
To extract attributes from Falcon's request object and use them as span attributes, set the environment variable
44
+
``OTEL_PYTHON_FALCON_TRACED_REQUEST_ATTRS`` to a comma delimited list of request attribute names.
The instrumentation supports specifying request and response hooks. These are functions that get called back by the instrumentation right after a Span is created for a request
77
-
and right before the span is finished while processing a response. The hooks can be configured as follows:
77
+
This instrumentation supports request and response hooks. These are functions that get called
78
+
right after a span is created for a request and right before the span is finished for the response.
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>`_.
93
+
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``
96
-
to a comma-separated list of HTTP header names.
98
+
To capture HTTP request headers as span attributes, set the environment variable
99
+
``OTEL_INSTRUMENTATION_HTTP_CAPTURE_HEADERS_SERVER_REQUEST`` to a comma delimited list of HTTP header names.
It is recommended that you should give the correct names of the headers to be captured in the environment variable.
107
-
Request header names in falcon 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``.
116
+
Would match all request headers that start with ``Accept`` and ``X-``.
108
117
109
-
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 _ ).
110
-
The value of the attribute will be single item list containing all the header values.
118
+
To capture all request headers, set ``OTEL_INSTRUMENTATION_HTTP_CAPTURE_HEADERS_SERVER_REQUEST`` to ``".*"``.
To capture predefined HTTP response headers as span attributes, set the environment variable ``OTEL_INSTRUMENTATION_HTTP_CAPTURE_HEADERS_SERVER_RESPONSE``
118
-
to a comma-separated list of HTTP header names.
132
+
To capture HTTP response headers as span attributes, set the environment variable
133
+
``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-``.
127
151
128
-
It is recommended that you should give the correct names of the headers to be captured in the environment variable.
129
-
Response header names captured in falcon are case insensitive. So, giving header name as ``CUStomHeader`` in environment variable will be able capture header with name ``customheader``.
152
+
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 _ ).
132
-
The value of the attribute will be single item list containing all the header values.
157
+
The name of the added span attribute will follow the format ``http.response.header.<header_name>`` where ``<header_name>``
158
+
is the normalized HTTP header name (lowercase, with ``-`` replaced by ``_``). The value of the attribute will be a
159
+
single item list containing all the header values.
0 commit comments