mirror of
https://github.com/hyperdxio/hyperdx
synced 2026-04-21 13:37:15 +00:00
fix: Update Services Dashboard count() queries to correctly use MVs (#1473)
Closes HDX-3057 This PR updates the Request Error Rate query config so that it can correctly leverage materialized views.
This commit is contained in:
parent
96f0539e7a
commit
19b710fb68
2 changed files with 22 additions and 2 deletions
5
.changeset/quick-insects-shop.md
Normal file
5
.changeset/quick-insects-shop.md
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
"@hyperdx/app": patch
|
||||
---
|
||||
|
||||
fix: Update Request Error Rate config to use MVs
|
||||
|
|
@ -342,8 +342,21 @@ function HttpTab({
|
|||
whereLanguage: appliedConfig.whereLanguage || 'sql',
|
||||
displayType: DisplayType.Line,
|
||||
select: [
|
||||
// Separate the aggregations from the rate calculation so that AggregatingMergeTree MVs can be used
|
||||
{
|
||||
valueExpression: `countIf(${expressions.isError}) / count()`,
|
||||
valueExpression: '',
|
||||
aggFn: 'count',
|
||||
alias: 'total_requests',
|
||||
},
|
||||
{
|
||||
valueExpression: '',
|
||||
aggFn: 'count',
|
||||
aggCondition: expressions.isError,
|
||||
aggConditionLanguage: 'sql',
|
||||
alias: 'error_requests',
|
||||
},
|
||||
{
|
||||
valueExpression: `error_requests / total_requests`,
|
||||
alias: 'error_rate',
|
||||
},
|
||||
],
|
||||
|
|
@ -502,6 +515,7 @@ function HttpTab({
|
|||
{source && requestErrorRateConfig && (
|
||||
<DBTimeChart
|
||||
sourceId={source.id}
|
||||
hiddenSeries={['total_requests', 'error_requests']}
|
||||
config={requestErrorRateConfig}
|
||||
showDisplaySwitcher={false}
|
||||
disableQueryChunking
|
||||
|
|
@ -1278,7 +1292,8 @@ function ErrorsTab({
|
|||
displayType: DisplayType.StackedBar,
|
||||
select: [
|
||||
{
|
||||
valueExpression: `count()`,
|
||||
valueExpression: '',
|
||||
aggFn: 'count',
|
||||
},
|
||||
],
|
||||
numberFormat: INTEGER_NUMBER_FORMAT,
|
||||
|
|
|
|||
Loading…
Reference in a new issue