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
Is your feature request related to a problem?
The duration of a request span in FastAPI includes the duration of evaluating background tasks. There is no span whose duration represents the time bewteen receiving a request and sending the response. An example:
Describe the solution you'd like
Either end the server span after we have sent the response (this is how dd-trace solve it in DataDog/dd-trace-py#3799)
OR create a new span that stops after the response has been sent.
Additional context
This is important to calculation latency metrics using the FastAPI instrumentation
The text was updated successfully, but these errors were encountered:
Thanks for reporting! We'll try to reproduce the issue.
I agree that there should be two new spans - producer (because FastAPI is producing the task) and consumer (because FastAPI is consuming the task, similarly to how celery instrumentation behaves). Is that what you had in mind?
i.e. the /foo span does not end until the background task has finished executing, even though the client has the response. There is no span that currently represents the time from receiving the request to the time sending it.
The celery implementation might do this if the consumer span is not a parent of the request span? We'd then have a whole different trace for the background task execution?
Is your feature request related to a problem?
The duration of a request span in FastAPI includes the duration of evaluating background tasks. There is no span whose duration represents the time bewteen receiving a request and sending the response. An example:
Describe the solution you'd like
Either end the server span after we have sent the response (this is how dd-trace solve it in DataDog/dd-trace-py#3799)
OR create a new span that stops after the response has been sent.
Additional context
This is important to calculation latency metrics using the FastAPI instrumentation
The text was updated successfully, but these errors were encountered: