Skip to content

Commit b1e445e

Browse files
fix: add missing instrumentation
1 parent 52bd660 commit b1e445e

File tree

1 file changed

+8
-2
lines changed
  • instrumentation/opentelemetry-instrumentation-fastapi/src/opentelemetry/instrumentation/fastapi

1 file changed

+8
-2
lines changed

instrumentation/opentelemetry-instrumentation-fastapi/src/opentelemetry/instrumentation/fastapi/__init__.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,12 @@ def _instrument(self, **kwargs):
347347
else parse_excluded_urls(_excluded_urls)
348348
)
349349
_InstrumentedFastAPI._meter_provider = kwargs.get("meter_provider")
350+
_InstrumentedFastAPI._exclude_receive_span = kwargs.get(
351+
"exclude_receive_span"
352+
)
353+
_InstrumentedFastAPI._exclude_send_span = kwargs.get(
354+
"exclude_send_span"
355+
)
350356
fastapi.FastAPI = _InstrumentedFastAPI
351357

352358
def _uninstrument(self, **kwargs):
@@ -397,8 +403,8 @@ def __init__(self, *args, **kwargs):
397403
http_capture_headers_server_request=_InstrumentedFastAPI._http_capture_headers_server_request,
398404
http_capture_headers_server_response=_InstrumentedFastAPI._http_capture_headers_server_response,
399405
http_capture_headers_sanitize_fields=_InstrumentedFastAPI._http_capture_headers_sanitize_fields,
400-
exclude_receive_span=False,
401-
exclude_send_span=False,
406+
exclude_receive_span=_InstrumentedFastAPI._exclude_receive_span,
407+
exclude_send_span=_InstrumentedFastAPI._exclude_send_span,
402408
)
403409
self._is_instrumented_by_opentelemetry = True
404410
_InstrumentedFastAPI._instrumented_fastapi_apps.add(self)

0 commit comments

Comments
 (0)