mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Apply fixes from StyleCI (#12124)
This commit is contained in:
@@ -76,8 +76,8 @@ class Prometheus extends BaseDatastore
|
||||
}
|
||||
|
||||
try {
|
||||
$vals = "";
|
||||
$promtags = "/measurement/" . $measurement;
|
||||
$vals = '';
|
||||
$promtags = '/measurement/' . $measurement;
|
||||
|
||||
foreach ($fields as $k => $v) {
|
||||
if ($v !== null) {
|
||||
@@ -87,7 +87,7 @@ class Prometheus extends BaseDatastore
|
||||
|
||||
foreach ($tags as $t => $v) {
|
||||
if ($v !== null) {
|
||||
$promtags .= (Str::contains($v, "/") ? "/$t@base64/" . base64_encode($v) : "/$t/$v");
|
||||
$promtags .= (Str::contains($v, '/') ? "/$t@base64/" . base64_encode($v) : "/$t/$v");
|
||||
}
|
||||
}
|
||||
$options = $this->getDefaultOptions();
|
||||
@@ -97,7 +97,7 @@ class Prometheus extends BaseDatastore
|
||||
if (Config::get('prometheus.attach_sysname', false)) {
|
||||
$promurl .= '/sysName/' . $device['sysName'];
|
||||
}
|
||||
$promurl = str_replace(" ", "-", $promurl); // Prometheus doesn't handle tags with spaces in url
|
||||
$promurl = str_replace(' ', '-', $promurl); // Prometheus doesn't handle tags with spaces in url
|
||||
|
||||
Log::debug("Prometheus put $promurl: ", [
|
||||
'measurement' => $measurement,
|
||||
@@ -114,7 +114,7 @@ class Prometheus extends BaseDatastore
|
||||
Log::error('Prometheus Error: ' . $result->getReasonPhrase());
|
||||
}
|
||||
} catch (GuzzleException $e) {
|
||||
Log::error("Prometheus Exception: " . $e->getMessage());
|
||||
Log::error('Prometheus Exception: ' . $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user