-
Type:
Bug
-
Resolution: Unresolved
-
Priority:
Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
DB Integration & Observability
-
ALL
-
-
0
-
None
-
None
-
None
-
None
-
None
-
None
-
None
The helpers in jstests/noPassthrough/observability/libs/otel_metrics_file_export_helpers.js assume one metrics file per node. For example getHistogramByAttributeAcrossFiles() (and its wrapper assertHistogramCountAcrossFilesSoon()) sums the last record of every *-metrics.jsonl file in the metrics directory. However, the OTel file exporter rotates files for a single node:
- at midnight UTC, because the file name embeds the date (mongodb-<pid>
%Y%m%d%N-metrics.jsonl, see src/mongo/otel/metrics/metrics_initialization.cpp) - when a file reaches the 8MB chunk limit (the %N rotation index)
Every rotated file retains its last cumulative snapshot, so after a rotation a single node's metrics are summed once per file and the aggregated values are inflated. Any test using these helpers can flake if its run crosses midnight UTC or triggers the chunk limit. Readers that keep their own per-file summing logic outside this library have hit this in the wild: BF-47068 failed after a run crossed midnight UTC, because the node had two files each reporting the same cumulative counter value of 1.
- related to
-
SERVER-138510 primary_driven.js resume metric reader double-counts after OTel metrics file rotation
-
- Closed
-