diff --git a/src/Prometheus/Storage/APC.php b/src/Prometheus/Storage/APC.php index 1e4b24c8..c45f1940 100644 --- a/src/Prometheus/Storage/APC.php +++ b/src/Prometheus/Storage/APC.php @@ -383,7 +383,7 @@ private function collectHistograms(): array 'name' => $metaData['name'] . '_sum', 'labelNames' => [], 'labelValues' => $decodedLabelValues, - 'value' => $this->fromBinaryRepresentationAsInteger($histogramBuckets[$labelValues]['sum']), + 'value' => $this->fromBinaryRepresentationAsInteger($histogramBuckets[$labelValues]['sum'] ?? 0), ]; } $histograms[] = new MetricFamilySamples($data); diff --git a/src/Prometheus/Storage/APCng.php b/src/Prometheus/Storage/APCng.php index ed468675..6628ef97 100644 --- a/src/Prometheus/Storage/APCng.php +++ b/src/Prometheus/Storage/APCng.php @@ -661,7 +661,7 @@ private function collectHistograms(): array 'name' => $metaData['name'] . '_sum', 'labelNames' => [], 'labelValues' => $decodedLabelValues, - 'value' => $this->convertIncrementalIntegerToFloat($histogramBuckets[$labelValues]['sum']), + 'value' => $this->convertIncrementalIntegerToFloat($histogramBuckets[$labelValues]['sum'] ?? 0), ]; } $histograms[] = new MetricFamilySamples($data);