mirror of
https://gitee.com/hyperf/hyperf.git
synced 2024-12-05 05:07:58 +08:00
fix: 修复Prometheus使用redis打点,改变label导致收集报错的问题
This commit is contained in:
parent
6402d179f6
commit
bd99a62afc
@ -284,7 +284,7 @@ LUA
|
|||||||
if ($d['b'] == 'sum') {
|
if ($d['b'] == 'sum') {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (count($d['labelValues']) != count($histogram['labelNames'])) {
|
if (count($d['labelValues']) !== count($histogram['labelNames'])) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
$allLabelValues[] = $d['labelValues'];
|
$allLabelValues[] = $d['labelValues'];
|
||||||
@ -348,7 +348,7 @@ LUA
|
|||||||
unset($raw['__meta']);
|
unset($raw['__meta']);
|
||||||
$gauge['samples'] = [];
|
$gauge['samples'] = [];
|
||||||
foreach ($raw as $k => $value) {
|
foreach ($raw as $k => $value) {
|
||||||
if (count($gauge['labelNames']) != count(json_decode($k, true))) {
|
if (count($gauge['labelNames']) !== count(json_decode($k, true))) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
$gauge['samples'][] = [
|
$gauge['samples'][] = [
|
||||||
@ -377,7 +377,7 @@ LUA
|
|||||||
unset($raw['__meta']);
|
unset($raw['__meta']);
|
||||||
$counter['samples'] = [];
|
$counter['samples'] = [];
|
||||||
foreach ($raw as $k => $value) {
|
foreach ($raw as $k => $value) {
|
||||||
if (count($counter['labelNames']) != count(json_decode($k, true))) {
|
if (count($counter['labelNames']) !== count(json_decode($k, true))) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
$counter['samples'][] = [
|
$counter['samples'][] = [
|
||||||
|
Loading…
Reference in New Issue
Block a user