Integrating with Drupal 7

Drupal 7 can be instrumented with a very simple module that adds support for transaction names. Create a folder sites/all/modules/tideways/ with a tideways.info file:

name = Tideways
description = Connects Drupal to Tideways
package = Tideways
core = 7.x
files[] = tideways.module
php = 5.3

Then add a second file tideways.module:

<?php

use Tideways\Profiler;

function tideways_help($path, $arg)
{
    if ($path == 'admin/help#tideways') {
        return t('Connect Drupal with Tideways');
    }
}

function tideways_menu_get_item_alter($route)
{
    if (!class_exists('Tideways\Profiler')) {
        return;
    }

    Profiler::setTransactionName($route['page_callback']);
}
Still need help? Email [email protected]