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-asgi/src/opentelemetry/instrumentation/asgi/__init__.py
+17-10
Original file line number
Diff line number
Diff line change
@@ -449,20 +449,27 @@ class OpenTelemetryMiddleware:
449
449
450
450
Args:
451
451
app: The ASGI application callable to forward requests to.
452
+
excluded_urls: (opentelemetry.util.http.ExcludeList) Optional parameter to specify URLs that should be excluded from tracing.
453
+
This can be useful for skipping health checks or other endpoints that do not need to be monitored.
454
+
Defaults to None.
452
455
default_span_details: Callback which should return a string and a tuple, representing the desired default span name and a
453
-
dictionary with any additional span attributes to set.
454
-
Optional: Defaults to get_default_span_details.
456
+
dictionary with any additional span attributes to set.
457
+
Optional: Defaults to get_default_span_details.
455
458
server_request_hook: Optional callback which is called with the server span and ASGI
456
-
scope object for every incoming request.
459
+
scope object for every incoming request.
457
460
client_request_hook: Optional callback which is called with the internal span and an ASGI
458
-
scope which is sent as a dictionary for when the method receive is called.
461
+
scope which is sent as a dictionary for when the method receive is called.
459
462
client_response_hook: Optional callback which is called with the internal span and an ASGI
460
-
event which is sent as a dictionary for when the method send is called.
461
-
excluded_urls: (opentelemetry.util.http.ExcludeList) Optional parameter to specify URLs that should be excluded from tracing.
462
-
This can be useful for skipping health checks or other endpoints that do not need to be monitored.
463
-
Defaults to None.
464
-
tracer_provider: The optional tracer provider to use. If omitted
465
-
the current globally configured one is used.
463
+
event which is sent as a dictionary for when the method send is called.
464
+
tracer_provider: The optional tracer provider to use. If omitted, the current globally configured one is used.
465
+
meter_provider: Optional. The meter provider to use for creating metric instruments. If omitted, the current globally configured meter provider is used.
466
+
This allows for the collection of metrics in addition to traces.
467
+
http_capture_headers_server_request: Optional. A list of request header names whose values will be captured in the span attributes for server requests.
468
+
This can be used to include specific HTTP request headers in the tracing information.
469
+
http_capture_headers_server_response: Optional. A list of response header names whose values will be captured in the span attributes for server responses.
470
+
This allows for including specific HTTP response headers in the tracing data.
471
+
http_capture_headers_sanitize_fields: Optional. A list of header names for which the values should be sanitized before being added to the span.
472
+
This is useful for headers that contain sensitive information that should not be stored in trace data.
0 commit comments