Back to Available Endpoints

query_grouped_requests__v1

GET
t_731d5c1b649d4bc3821e7d0d4fd29348

Lets you query 3 materialized views with aggregations by different columns, on different timeframes, select the grouping and order by columns. This endpoint returns: - requests per unit of time and how it evolves over time: add date to the group_by param - bandwidth use (total and average) and how it evolves over time. Total, median and avg bytes sent are returned for each group. To see the evolution over time, also add date to the group_by param - error codes distribution: count_status_2xx, count_status_3xx, count_status_4xx, count_status_429 and count_status_5xx are returned for each row as well - distribution of calls to API endpoints vs the Tinybird API, or ingestion vs queries, etc.: this can be achieved adding path_part_1 to group_by. Columns returned per group: - count_requests - count_status_2xx - count_status_3xx - count_status_4xx - count_status_429 - count_status_5xx - count_get_requests - count_post_requests - count_put_requests - count_delete_requests - unique_ips - body_bytes_sent_sum - body_bytes_sent_avg
- body_bytes_sent_median - body_bytes_sent_p90 - body_bytes_sent_p95 - body_bytes_sent_p99 Selects the MV to query from depending on the interval of days between start_date and end_date. The possible values for group_by and order_by are (comma-separated): - date - path_part_1 - path_part_2 - path_part_3 - path_part_4 - request_method - status Possible values for order_by: - count_requests - count_status_2xx - count_status_3xx - count_status_4xx - count_status_429 - count_status_5xx - count_get_requests - count_post_requests - count_put_requests - count_delete_requests - unique_ips - body_bytes_sent_sum - body_bytes_sent_avg
- body_bytes_sent_median - body_bytes_sent_p90 - body_bytes_sent_p95 - body_bytes_sent_p99 plus the columns you pass in the group_by param Examples: - Requests per period: ?group_by=date&start_date=2021-04-13&end_date=2021-04-21 - Requests per period (will group per month as the interval is bigger than 30 days): ?group_by=date&start_date=2020-04-13&end_date=2021-04-21 - Requests per period (will group per hour as the interval is lower than 7 days): ?group_by=date&start_date=2021-04-18&end_date=2021-04-21 - Endpoints with the most request (high level): ?group_by=path_part_1&order_by=count_requests&start_date=2021-04-13&end_date=2021-04-21 - Endpoints with the most request (more detail): ?group_by=path_part_1,path_part_2&order_by=count_requests&start_date=2021-04-13&end_date=2021-04-21 - Endpoints with the most errors (even more detailed): ?group_by=path_part_1,path_part_2,path_part_3&order_by=count_status_5xx&start_date=2021-04-13&end_date=2021-04-21

Available parameters

Name
Type
Defaults to
Description
cols* array(string) count_requests,count_status_2xx,count_status_3xx,count_status_4xx,count_status_429,count_status_5xx,count_get_requests,count_post_requests,count_put_requests,count_delete_requests,unique_ips,body_bytes_sent_sum,body_bytes_sent_avg,body_bytes_sent_median,body_bytes_sent_p90,body_bytes_sent_p95,body_bytes_sent_p99 Columns to group by
end_date* string 2021-04-21 End date, format YYYY-MM-DD
group_by* array(string) date Columns to group by
start_date* string 2021-04-13 Start date, format YYYY-MM-DD
order_by array(string) date Columns to order by, in desc order

Check out our documentation to learn how to customize your response by using the q parameter and the available formats in your request. Parameters with * means it is required.

Sample usage

Open in