x:Metric: say which node wrote each sample
Each node stores histograms as running totals since it started. A sample didn't say which node wrote it (the node was only in the id's low bits), so a reader couldn't diff totals per node, and the console diffed across nodes: on the three-node production cluster the delivery attempt time read 14.7 s over the last hour against 0.7 s from the nodes' own figures. x:Metric/get now returns nodeId alongside timestamp, both from the id. The telemetry suite checks every sample carries it.
This commit is contained in:
@@ -2,6 +2,8 @@
|
||||
* SPDX-FileCopyrightText: 2020 Stalwart Labs LLC <[email protected]>
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-SEL
|
||||
*
|
||||
* Modified by Coffey Labs in 2026 for INBUXA.
|
||||
*/
|
||||
|
||||
use crate::utils::server::TestServer;
|
||||
@@ -53,6 +55,15 @@ pub async fn test(test: &TestServer) {
|
||||
);
|
||||
assert_eq!(metrics.len(), metric_ids.len());
|
||||
|
||||
// Every sample says which node wrote it, so histogram totals can be
|
||||
// diffed per node
|
||||
for metric in metrics {
|
||||
assert!(
|
||||
metric.get("nodeId").is_some_and(|v| v.is_u64()),
|
||||
"Missing nodeId in {metric}"
|
||||
);
|
||||
}
|
||||
|
||||
// Fetch the last 48 hours of metrics
|
||||
let metric_ids = admin
|
||||
.registry_query(
|
||||
|
||||
Reference in New Issue
Block a user