diff --git a/src/Extension/MokoWaaS.php b/src/Extension/MokoWaaS.php index 9be73669..9766490d 100644 --- a/src/Extension/MokoWaaS.php +++ b/src/Extension/MokoWaaS.php @@ -2711,8 +2711,9 @@ class MokoWaaS extends CMSPlugin /** * Send heartbeat to the MokoWaaS monitoring receiver. * - * Registers this site (and any aliases) with the Grafana provisioning system. + * Registers this site's primary domain with the Grafana provisioning system. * The receiver writes a datasource YAML file and restarts Grafana. + * Alias domains are not registered to avoid duplicate datasource UIDs. * * @param \Joomla\Registry\Registry $params Plugin params * @param \Joomla\CMS\Application\CMSApplication $app Application @@ -2733,35 +2734,8 @@ class MokoWaaS extends CMSPlugin $siteUrl = rtrim(Uri::root(), '/'); $siteName = Factory::getConfig()->get('sitename', 'Joomla'); - // Register primary domain + // Register primary domain only — aliases should not get separate datasources $this->sendHeartbeat($siteUrl, $siteName, $healthToken, $app); - - // Register any alias domains (subform format: array of objects with domain key) - $aliases = $params->get('site_aliases', ''); - - if (!empty($aliases)) - { - if (is_string($aliases)) - { - $aliases = json_decode($aliases, false); - } - - if (is_array($aliases)) - { - foreach ($aliases as $alias) - { - $alias = (object) $alias; - - if (!empty($alias->domain)) - { - $domain = trim($alias->domain); - $aliasUrl = 'https://' . preg_replace('#^https?://#i', '', $domain); - $aliasUrl = rtrim($aliasUrl, '/'); - $this->sendHeartbeat($aliasUrl, $siteName, $healthToken, $app); - } - } - } - } } /**