From b0284ebf201bc97f6e5171dfa4f111a8ac012cdd Mon Sep 17 00:00:00 2001 From: Dan Johansson Date: Thu, 3 Dec 2020 10:23:52 +0100 Subject: [PATCH 1/2] Update graphpanelinfluxdb.php --- histou/grafana/graphpanel/graphpanelinfluxdb.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/histou/grafana/graphpanel/graphpanelinfluxdb.php b/histou/grafana/graphpanel/graphpanelinfluxdb.php index 1eecea2..f1291cf 100644 --- a/histou/grafana/graphpanel/graphpanelinfluxdb.php +++ b/histou/grafana/graphpanel/graphpanelinfluxdb.php @@ -80,8 +80,11 @@ public function genTargetSimple($host, $service, $command, $performanceLabel, $c **/ public function genTarget($host, $service, $command, $performanceLabel, $color = '#085DFF', $alias = '', $useRegex = false, $customSelect = null) { + $keepAlias = false; if ($alias == '') { $alias = $performanceLabel; + } else { + $keepAlias = true; } if ($useRegex) { $target = $this->createTarget(array( @@ -98,7 +101,7 @@ public function genTarget($host, $service, $command, $performanceLabel, $color = 'performanceLabel' => array('value' => $performanceLabel) )); } - return $this->addXToTarget($target, array('value'), $alias, $color, false, $customSelect); + return $this->addXToTarget($target, array('value'), $alias, $color, $keepAlias, $customSelect); } public function addWarnToTarget($target, $alias = '', $color = true, $keepAlias = false) From 42d278c535290d4bd23ba7f9b2c5f8fd8fa07e5d Mon Sep 17 00:00:00 2001 From: Dan Johansson Date: Thu, 3 Dec 2020 14:46:16 +0100 Subject: [PATCH 2/2] Changed default timeframe to 24h --- histou/grafana/dashboard/dashboard.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/histou/grafana/dashboard/dashboard.php b/histou/grafana/dashboard/dashboard.php index 9ad9e71..c9b5cfe 100644 --- a/histou/grafana/dashboard/dashboard.php +++ b/histou/grafana/dashboard/dashboard.php @@ -44,7 +44,7 @@ abstract class Dashboard 'notice' => false, )), 'time' => array( - 'from' => 'now-8h', + 'from' => 'now-24h', 'to' => 'now', ), 'templating' => array(),