-
Notifications
You must be signed in to change notification settings - Fork 788
Open
Labels
Description
For Kubernetes I have implemented healthchecks in FastAPI like this
@router.get("/health/liveness", tags=["health_checks"])
async def liveness():
if check_liveness():
result = {"status": "UP"}
else:
result = {"result": "DOWN"}
return result
However, opentelemetry always gives errors in these spans. Not sure why. This is the error I get in Datadog Tracing
CancelledError
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/opentelemetry/trace/__init__.py", line 522, in use_span
yield span
File "/usr/local/lib/python3.7/site-packages/opentelemetry/sdk/trace/__init__.py", line 879, in start_as_current_span
yield span_context
File "/usr/local/lib/python3.7/site-packages/opentelemetry/instrumentation/asgi/__init__.py", line 213, in wrapped_receive
message = await receive()
File "/usr/local/lib/python3.7/site-packages/uvicorn/protocols/http/h11_impl.py", line 526, in receive
await self.message_event.wait()
File "/usr/local/lib/python3.7/asyncio/locks.py", line 293, in wait
await fut
concurrent.futures._base.CancelledError
And this happens for all the endpoints. Not sure whats up. Any help is appreciated.