arku31/roadrunner-newrelic

Implementation of the communication between the golang and php sides of roadrunner

0.1.5 2022-02-21 09:59 UTC

This package is auto-updated.

Last update: 2024-04-21 14:27:23 UTC


README

Usage

$transactionDetail = new TransactionDetail();
$transactionDetail->setName('test');
$transactionDetail->setCustomData('key', 'value');

$segment = new Segment();
$segment->setName('testSegment');
$segment->setDuration('1');
$segment->setMeta(['testmetakey' => 'testmetavalue']);

$transactionDetail->addSegment($segment);

$enricher = new EnrichResponse(new TransactionDetailTransformer());
$response = $enricher->enrich($response, $transactionDetail);

Note: Duration tracking is not available atm due to restriction of the newrelic golang library.

Transaction can be marked as ignored with

$transactionDetail->ignoreTransaction();

In this case, roadrunner will not send this transaction to newrelic. This is useful f.e. for some health endpoints

License: MIT

See https://github.com/arku31/newrelic-roadrunner-sample for example