Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Elastic Apm Php Agent Laravel Package

nipwaayoni/elastic-apm-php-agent

Laravel-friendly Elastic APM PHP agent for instrumenting apps and sending performance data, errors, and transactions to an Elastic APM Server. Helps monitor response times, slow queries, and exceptions with simple setup and configurable reporting.

View on GitHub
Deep Wiki
Context7

Transaction without minimal Meta data and Context

$transaction = $agent->startTransaction('Simple Transaction');
// Do some stuff you want to watch ...
$agent->stopTransaction($transaction->getTransactionName());

Transaction with Meta data and Contexts

$trxName = 'Demo Transaction with more Data';
$agent->startTransaction( $trxName );
// Do some stuff you want to watch ...
$agent->stopTransaction( $trxName, [
    'result' => '200',
    'type'   => 'demo'
] );
$agent->getTransaction( $trxName )->setUserContext( [
    'id'    => 12345,
    'email' => "hello@acme.com",
 ] );
 $agent->getTransaction( $trxName )->setCustomContext( [
    'foo' => 'bar',
    'bar' => [ 'foo1' => 'bar1', 'foo2' => 'bar2' ]
] );
$agent->getTransaction( $trxName )->setTags( [ 'k1' => 'v1', 'k2' => 'v2' ] );

Example of a Transaction

This example illustrates how you can monitor a call to another web service.

$agent = (new \Nipwaayoni\AgentBuilder())
    ->withConfig(new Nipwaayoni\Config(['serviceName' => 'examples']))
    ->build();

$endpoint = 'https://acme.com/api/';
$payload  = [ 'foo' => 'bar' ];
$client   = new GuzzleHttp\Client();

// Start the Transaction
$transaction = $agent->startTransaction('POST https://acme.com/api/');

// Do the call via curl/Guzzle e.g.
$response = $client->request('POST', $endpoint, [
    'json' => $payload
]);

// Stop the Transaction tracing, attach the Status and the sent Payload
$agent->stopTransaction($transaction->getTransactionName(), [
    'status'  => $response->getStatusCode(),
    'payload' => $payload,
]);

// The collected traces will be send to the APM server as soon as
// the Agent object is destroyed. But, you can manually flush the
// playload queue with $agent->send();
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
jayeshmepani/jpl-moshier-ephemeris-php
elnasnato/laraliveui
labrodev/rest-sdk
sampaui/sampaui
babelqueue/php-sdk
facebook/capi-param-builder-php
babelqueue/symfony
hamzi/corewatch
minionfactory/raw-hydrator
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours
renatovdemoura/blade-elements-ui
devgeek/beacon-admin
benjamin-rqt/data-watcher-bundle