Skip to content

Commit

Permalink
transaction custom type
Browse files Browse the repository at this point in the history
  • Loading branch information
ilvalerione committed Jul 3, 2024
1 parent e732672 commit 3429a09
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"illuminate/console": "^5.5|^6.0|^7.0|^8.0|^9.0|^10.0|^11.0",
"illuminate/contracts": "^5.5|^6.0|^7.0|^8.0|^9.0|^10.0|^11.0",
"illuminate/support": "^5.5|^6.0|^7.0|^8.0|^9.0|^10.0|^11.0",
"inspector-apm/inspector-php": "^3.7.18"
"inspector-apm/inspector-php": "^3.8.0"
},
"autoload": {
"psr-4": {
Expand Down
2 changes: 1 addition & 1 deletion src/InspectorServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class InspectorServiceProvider extends ServiceProvider
*
* @var string
*/
const VERSION = '4.8.7';
const VERSION = '4.9.0';

/**
* Booting of services.
Expand Down
5 changes: 1 addition & 4 deletions src/Middleware/WebRequestMonitoring.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,7 @@ protected function startTransaction($request)
$this->buildTransactionName($request)
);

// todo: add an argument to the Transaction __constructor
$transaction->type = Transaction::TYPE_REQUEST;

$transaction->addContext(
$transaction->markAsRequest()->addContext(
'Request Body',
Filters::hideParameters(
$request->request->all(),
Expand Down
1 change: 1 addition & 0 deletions src/Providers/CommandServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ public function boot()

if (Inspector::needTransaction()) {
Inspector::startTransaction($event->command)
->setType('artisan')
->addContext('Command', [
'arguments' => $event->input->getArguments(),
'options' => $event->input->getOptions(),
Expand Down
1 change: 1 addition & 0 deletions src/Providers/JobServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ protected function handleJobStart(Job $job)
{
if (Inspector::needTransaction()) {
Inspector::startTransaction($job->resolveName())
->setType('job')
->addContext('Payload', $job->payload());
} elseif (Inspector::canAddSegments()) {
$this->initializeSegment($job);
Expand Down

0 comments on commit 3429a09

Please sign in to comment.