Skip to content

Commit 255de61

Browse files
committed
Modify test case to account for changes
1 parent 35d2977 commit 255de61

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -409,6 +409,10 @@ def _get_route_details(scope, app=None):
409409
"""
410410
Function to retrieve the full route path, handling mounted sub-applications (Mount) recursively.
411411
412+
TODO: there is currently no way to retrieve http.route from
413+
a starlette application from scope.
414+
See: https://github.com/encode/starlette/pull/804
415+
412416
Args:
413417
scope: A FastAPI/Starlette scope
414418
app: The FastAPI/Starlette app or sub-app (defaults to the app in scope)

instrumentation/opentelemetry-instrumentation-fastapi/tests/test_fastapi_instrumentation.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,8 +230,7 @@ def test_sub_app_fastapi_call(self):
230230
spans = self.memory_exporter.get_finished_spans()
231231
self.assertEqual(len(spans), 3)
232232
for span in spans:
233-
# As we are only looking to the "outer" app, we would see only the "GET /sub" spans
234-
self.assertIn("GET /sub", span.name)
233+
self.assertIn("GET /sub/home", span.name)
235234

236235
# We now want to specifically test all spans including the
237236
# - HTTP_TARGET

0 commit comments

Comments
 (0)