Merge branch 'fix/prometheus-single-stat-point-slot' into 'master'

fix(prometheus-exporter): write to container[0] in single-stat-point mode

See merge request rist/librist!345
This commit is contained in:
Sergio Ammirata
2026-06-06 00:48:34 +00:00
2 changed files with 13 additions and 3 deletions
+4
View File
@@ -43,6 +43,10 @@ Bug Fixes:
- Prometheus exporter: counter rows in multiple_metric_datapoints
mode now have a space between the value and the timestamp.
Affected every existing _total row.
- Prometheus exporter: in single_stat_point mode, the displayed
value no longer freezes at the first callback and silently
drops every subsequent sample. Affected all receiver-flow,
sender-peer, and per-peer-receiver gauges.
- Receiver flow stats: bitrate, bitrate_retries, bitrate_rejected
and bitrate_ts_nulls now decay to zero when the corresponding
traffic stops, instead of remaining frozen at the last value
+9 -3
View File
@@ -389,7 +389,9 @@ void rist_prometheus_handle_client_stats(struct rist_prometheus_stats *ctx, cons
s->container_count++;
}
} else {
s->container_offset = 1;
/* Single-stat-point mode: format reads container[0] only
* (container_count stays at 1), so the next write must land there. */
s->container_offset = 0;
s->container_count = 1;
}
@@ -446,7 +448,9 @@ void rist_prometheus_handle_client_stats(struct rist_prometheus_stats *ctx, cons
ps->container_count++;
}
} else {
ps->container_offset = 1;
/* Single-stat-point mode: format reads container[0] only
* (container_count stays at 1), so the next write must land there. */
ps->container_offset = 0;
ps->container_count = 1;
}
}
@@ -536,7 +540,9 @@ void rist_prometheus_handle_sender_peer_stats(struct rist_prometheus_stats *ctx,
s->container_count++;
}
} else {
s->container_offset = 1;
/* Single-stat-point mode: format reads container[0] only
* (container_count stays at 1), so the next write must land there. */
s->container_offset = 0;
s->container_count = 1;
}
}