Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/quick-insects-shop.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@hyperdx/app": patch
---

fix: Update Request Error Rate config to use MVs
19 changes: 17 additions & 2 deletions packages/app/src/ServicesDashboardPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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: '',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: is valueExpression needed here anymore? Could it just be left out?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is unfortunately required to satisfy the current types. We could potentially introduce an additional union item here to support an undefined valueExpression for aggFn: 'count'

Screenshot 2025-12-15 at 9 28 42 AM

aggFn: 'count',
aggCondition: expressions.isError,
aggConditionLanguage: 'sql',
alias: 'error_requests',
},
{
valueExpression: `error_requests / total_requests`,
alias: 'error_rate',
},
],
Expand Down Expand Up @@ -502,6 +515,7 @@ function HttpTab({
{source && requestErrorRateConfig && (
<DBTimeChart
sourceId={source.id}
hiddenSeries={['total_requests', 'error_requests']}
config={requestErrorRateConfig}
showDisplaySwitcher={false}
disableQueryChunking
Expand Down Expand Up @@ -1278,7 +1292,8 @@ function ErrorsTab({
displayType: DisplayType.StackedBar,
select: [
{
valueExpression: `count()`,
valueExpression: '',
aggFn: 'count',
},
],
numberFormat: INTEGER_NUMBER_FORMAT,
Expand Down
Loading