Skip to content

Commit

Permalink
fix: add missing instrumentation
Browse files Browse the repository at this point in the history
  • Loading branch information
omgitsaheadcrab committed Aug 19, 2024
1 parent 52bd660 commit b1e445e
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,12 @@ def _instrument(self, **kwargs):
else parse_excluded_urls(_excluded_urls)
)
_InstrumentedFastAPI._meter_provider = kwargs.get("meter_provider")
_InstrumentedFastAPI._exclude_receive_span = kwargs.get(
"exclude_receive_span"
)
_InstrumentedFastAPI._exclude_send_span = kwargs.get(
"exclude_send_span"
)
fastapi.FastAPI = _InstrumentedFastAPI

def _uninstrument(self, **kwargs):
Expand Down Expand Up @@ -397,8 +403,8 @@ def __init__(self, *args, **kwargs):
http_capture_headers_server_request=_InstrumentedFastAPI._http_capture_headers_server_request,
http_capture_headers_server_response=_InstrumentedFastAPI._http_capture_headers_server_response,
http_capture_headers_sanitize_fields=_InstrumentedFastAPI._http_capture_headers_sanitize_fields,
exclude_receive_span=False,
exclude_send_span=False,
exclude_receive_span=_InstrumentedFastAPI._exclude_receive_span,
exclude_send_span=_InstrumentedFastAPI._exclude_send_span,
)
self._is_instrumented_by_opentelemetry = True
_InstrumentedFastAPI._instrumented_fastapi_apps.add(self)
Expand Down

0 comments on commit b1e445e

Please sign in to comment.