Now that the app has some complex queries that leverage CTEs, metrics for example, it's common for the logic in this optimization to throw an exception. When that happens, the query rendering logic continues without a problem but generates a noisy line in the console log. We can just remove this log message to clean up the debugging experience.
Ref: HDX-1763
* Utilizes renderChartConfig and CH client to query for chart data
* Implements API input schema
* Adds lots of tests
Testing Notes:
* To use swagger, go to localhost:8000/api/v2/docs
* Authorize using your access key found in localhost:8000/me
* Under the charts route, click "Try it out"
* Use example payload:
*
```
{
"startTime": <insert valid timestamp ms>,
"endTime": <insert valid timestamp ms>,
"granularity": "1h",
"series": [
{
"sourceId": "<insert valid sourceid>",
"aggFn": "count",
"where": "SeverityText:error",
"groupBy": []
}
]
}
```
It was easiest for me to go to the UI, create a new chart and grab the sourceid and start/end timestamps from the URL, plug it in and profit.
Note: It was apparent to me that we will need to provide at least GET support for sources, otherwise that ID is not easily obtained.
Ref: HDX-1651
Ref: HDX-1631
1. use temp centralized `queryChartConfig` to handle multi-series chart (metrics specifically)
2. move ratio computation logics (events chart) to the renderChartConfig
3. fix missing `seriesReturnType` prop in chartConfig in the checkAlert file
Pulls a set of test cases from the v1 code base that checks histogram metric queries against different quantile and queries for edge bounds as well.
Ref: HDX-1425
## feat: allow CTE definitions to be nested chart configs
In order to easily use a CTE for fixing large index issues with delta
trace events, this commit updates the type and `renderWith` function to
render a nested chart config.
Ref: HDX-1343
---
## fix: use CTE instead of listing all index parts in query
Instead of sending 2 queries to the DB and enumerating all of parts
and offsets in the query, this change uses a CTE to select the parts.
This reduces the size of the HTTP request, which fixes the URI too
long response.
Ref: HDX-1343
1. Eliminates a subquery select by pulling the handful of subquery fields up a level.
2. Removed `intDivOrZero` usage as this rounded fractional amounts to the nearest whole number, over/under stating the value.
3. Formatting of query now matches other queries.
Ref: HDX-1467
<img width="1310" alt="Screenshot 2025-02-25 at 3 43 11 PM" src="https://github.com/user-attachments/assets/38c98bc2-2ff2-412c-b26d-4ed9952439f2" />
Co-authored-by: Mike Shi <2781687+MikeShi42@users.noreply.github.com>
Co-authored-by: Dan Hable <418679+dhable@users.noreply.github.com>
Co-authored-by: Tom Alexander <3245235+teeohhem@users.noreply.github.com>