From cc8690fdda1b4e463caa5ed699ae39faefebea77 Mon Sep 17 00:00:00 2001 From: Markus Opolka Date: Tue, 24 Jun 2025 11:37:45 +0200 Subject: [PATCH] Shift graph_debug URL parameter in graphs overview - This also adds the InternalProcessTracker to all the graphs in the overview --- application/controllers/HostsController.php | 7 +++++++ application/controllers/ServicesController.php | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/application/controllers/HostsController.php b/application/controllers/HostsController.php index 85cd2db..582c382 100644 --- a/application/controllers/HostsController.php +++ b/application/controllers/HostsController.php @@ -5,6 +5,7 @@ namespace Icinga\Module\Graphite\Controllers; use GuzzleHttp\Psr7\ServerRequest; +use Icinga\Module\Graphite\Util\InternalProcessTracker as IPT; use Icinga\Module\Graphite\Web\Controller\IcingadbGraphiteController; use Icinga\Module\Graphite\Web\Controller\TimeRangePickerTrait; use Icinga\Module\Graphite\Web\Widget\IcingadbGraphs; @@ -28,7 +29,13 @@ class HostsController extends IcingadbGraphiteController } // shift graph params to avoid exception + $graphDebug = $this->params->shift('graph_debug'); $graphRange = $this->params->shift('graph_range'); + + if ($graphDebug) { + IPT::enable(); + } + $baseFilter = $graphRange ? Filter::equal('graph_range', $graphRange) : null; foreach ($this->preservedParams as $param) { $this->params->shift($param); diff --git a/application/controllers/ServicesController.php b/application/controllers/ServicesController.php index 48a353d..18ba82a 100644 --- a/application/controllers/ServicesController.php +++ b/application/controllers/ServicesController.php @@ -3,6 +3,7 @@ namespace Icinga\Module\Graphite\Controllers; use GuzzleHttp\Psr7\ServerRequest; +use Icinga\Module\Graphite\Util\InternalProcessTracker as IPT; use Icinga\Module\Graphite\Web\Controller\IcingadbGraphiteController; use Icinga\Module\Graphite\Web\Controller\TimeRangePickerTrait; use Icinga\Module\Graphite\Web\Widget\IcingadbGraphs; @@ -26,7 +27,13 @@ class ServicesController extends IcingadbGraphiteController } // shift graph params to avoid exception + $graphDebug = $this->params->shift('graph_debug'); $graphRange = $this->params->shift('graph_range'); + + if ($graphDebug) { + IPT::enable(); + } + $baseFilter = $graphRange ? Filter::equal('graph_range', $graphRange) : null; foreach ($this->preservedParams as $param) { $this->params->shift($param);