Joomla

We are working on adding Joomla support to the core of Tideways, but even now you can already have a full experience by using our custom instrumentation APIs. The following instrumentations have been tested with Joomla 3.8+

For transaction tracking you can configure the following in your INI file:

tideways.framework=Joomla\CMS\Component\ComponentHelper::renderComponent

To instrument different stages in the Joomla request lifecycle, you can add the following code to a file in your Joomla project and then include this file from the main index.php and the one in the administration folder:

<?php

use Tideways\Profiler;

Profiler::watchCallback('Joomla\CMS\Component\ComponentHelper::executeComponent', function ($context) {
    if (!isset($context['args'][0]) || !is_string($context['args'][0])) {
        return;
    }

    $span = Profiler::createSpan('php.ctrl');
    $span->annotate(
        [
            'title' => basename(dirname($context['args'][0])) . '/' .basename($context['args'][0])
        ]
    );

    return $span;
});

Profiler::watchCallback('JEventDispatcher::trigger', function ($context) {
    if (!isset($context['args'][0]) || !is_string($context['args'][0])) {
        return;
    }

    $span = Profiler::createSpan('event');
    $span->annotate(['title' => $context['args'][0]]);

    return $span;
});

Profiler::watchCallback('Joomla\CMS\Application\CMSApplication::render', function ($context) {
    if (!isset($context['object']) || !is_object($context['object'])) {
        return;
    }

    $span = Profiler::createSpan('view');
    $span->annotate(
        [
            'title' => $context['object']->get('themeFile', 'index.php')
        ]
    );

    return $span;
});

Profiler::watch('Joomla\CMS\Application\WebApplication::loadSession');
Profiler::watch('Joomla\CMS\Application\WebApplication::loadDocument');
Profiler::watch('Joomla\CMS\Application\WebApplication::loadLanguage');
Profiler::watch('Joomla\CMS\Application\WebApplication::loadDispatcher');
Profiler::watch('Joomla\CMS\Application\WebApplication::respond');
Profiler::watch('Joomla\CMS\Application\SiteApplication::initialiseApp');
Profiler::watch('Joomla\CMS\Application\SiteApplication::dispatch');
Profiler::watch('Joomla\CMS\Application\SiteApplication::route');
Still need help? Email [email protected]