Skip to content
Open
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
14 changes: 14 additions & 0 deletions .changeset/metric-series-scope-name.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
'@hyperdx/common-utils': patch
'@hyperdx/app': patch
'@hyperdx/api': patch
---

fix: keep metric series from different instrumentation scopes apart

Two instrumentation scopes can report the same metric with the same resource,
scope and point attributes. Metric charts and alerts keyed a series on those
attributes only, so they read the two scopes as one series: a gauge kept one
scope's value, a counter's `increase` and a histogram's count compared one
scope's total with the other's, and a group-by on `ScopeName` showed one scope.
The series key now includes `ScopeName`.
Original file line number Diff line number Diff line change
Expand Up @@ -1139,7 +1139,7 @@ describe('renderChartConfig', () => {
// Row B: ResourceAttributes={service.name: api}, Attributes={host: h1}
//
// AttributesHash is now computed as the variadic
// cityHash64(ScopeAttributes, ResourceAttributes, Attributes)
// cityHash64(ScopeName, ScopeAttributes, ResourceAttributes, Attributes)
// for all metric schemas (Map and JSON), so the two rows hash
// distinctly: each lands in its own series. Both rows are then the
// first row of their respective series, the lagInFrame Rate is NULL
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7738,7 +7738,7 @@ describe('checkAlerts', () => {

// Insert gauge metrics for two different services
// Note: ResourceAttributes must differ per service so that
// AttributesHash (variadic cityHash64(ScopeAttributes, ResourceAttributes, Attributes))
// AttributesHash (variadic cityHash64(ScopeName, ScopeAttributes, ResourceAttributes, Attributes))
// produces distinct hashes. Otherwise, the Bucketed CTE collapses all rows into one group.
const gaugePoints = [
// service-a: high CPU values (should trigger alert)
Expand Down
Loading
Loading