Skip to content

Commit

Permalink
fix: query to extract metrics names + Summary count UI label (#480)
Browse files Browse the repository at this point in the history
Fix the case when metric name is like 'ProcessedBytes_TCP_sum'
  • Loading branch information
wrn14897 authored Jul 24, 2024
1 parent 7b4993c commit 19a4086
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/afraid-days-deny.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@hyperdx/api': patch
---

fix: query to extract metrics names
5 changes: 5 additions & 0 deletions .changeset/funny-singers-give.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@hyperdx/app': patch
---

style: Summary count UI label
12 changes: 10 additions & 2 deletions packages/api/src/clickhouse/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -676,7 +676,11 @@ export const getMetricsNames = async ({
data_type,
if(
data_type = ?,
format('{} - {}', splitByChar('_', name)[1], data_type),
format(
'{} - {}',
replaceRegexpOne(name, '_[^_]+$', ''),
data_type
),
format('{} - {}', name, data_type)
) AS name
FROM ??
Expand Down Expand Up @@ -750,7 +754,11 @@ export const getMetricsTags = async ({
data_type,
if(
data_type = ?,
format('{} - {}', splitByChar('_', name)[1], data_type),
format(
'{} - {}',
replaceRegexpOne(name, '_[^_]+$', ''),
data_type
),
format('{} - {}', name, data_type)
) AS combined_name
FROM ??
Expand Down
2 changes: 1 addition & 1 deletion packages/app/src/ChartUtils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export const getMetricAggFns = (
{ value: 'sum', label: 'Sum' },
{ value: 'max', label: 'Maximum' },
{ value: 'min', label: 'Minimum' },
{ value: 'count', label: 'Count' },
{ value: 'count', label: 'Sample Count' },
];
}

Expand Down

0 comments on commit 19a4086

Please sign in to comment.