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
When using the FastAPI instrumentation, the default "Percent of 2xx Requests" chart query matches both the root {HTTP METHOD} {URL} span + the FastAPI arguments inner span. However, the "FastAPI arguments" inner span does not record a http.status_code (naturally) so that row has http_status_code=null, which then doubles count_all_requests, capping percent_2xx_requests at 50%.
Adding and attributes ? 'http.status_code' or and parent_span_id is NULL to the WHERE clause in the first CTE might be the easiest fix.
If this isn't the right place to submit bugs for the console, happy to post elsewhere!
Python, Logfire & OS Versions, related packages (not required)
JacobHayes
changed the title
Web Server Monitoring Dashboard Percent of 2xx Requests miscount with FastAPI
Web Server Monitoring Dashboard Percent of {2,5}xx Requests miscount with FastAPI
Oct 22, 2024
JacobHayes
changed the title
Web Server Monitoring Dashboard Percent of {2,5}xx Requests miscount with FastAPI
Web Server Monitoring Dashboard request miscount with FastAPI
Oct 22, 2024
Requests Average Duration (~halving durations, since the FastAPI Arguments time is ~always so fast)
Trend Routes (doubling counts)
The other charts seem to either filter by attributes ? 'http.status_code' (eg: Requests) or parent_span_id is null (eg: Exceptions).
Adding the filters to the queries might be fine, but alternatively maybe it'd make sense to remove the http.method and http.route attributes from the FastAPI Arguments span (logfire.fastapi) since it'll always(?) be nested within the opentelemetry.instrumentation.fastapi span.
Description
When using the FastAPI instrumentation, the default "Percent of 2xx Requests" chart query matches both the root
{HTTP METHOD} {URL}
span + theFastAPI arguments
inner span. However, the "FastAPI arguments" inner span does not record ahttp.status_code
(naturally) so that row hashttp_status_code=null
, which then doublescount_all_requests
, cappingpercent_2xx_requests
at 50%.Adding
and attributes ? 'http.status_code'
orand parent_span_id is NULL
to theWHERE
clause in the first CTE might be the easiest fix.If this isn't the right place to submit bugs for the console, happy to post elsewhere!
Python, Logfire & OS Versions, related packages (not required)
The text was updated successfully, but these errors were encountered: