Skip to content

Update tracing operation names #533

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

- Add support for Laravel 9 (#534)
- Fix double wrapping the log channel in a `FingersCrossedHandler` on Laravel `v8.97` and newer when `action_level` option is set on the Log channel config (#534)
- Update span operation names to match what Sentry server is expecting (#533)

## 2.10.2

Expand Down
4 changes: 2 additions & 2 deletions src/Sentry/Laravel/Tracing/EventHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ private function recordQuerySpan($query, $time): void
}

$context = new SpanContext();
$context->setOp('sql.query');
$context->setOp('db.sql.query');
$context->setDescription($query);
$context->setStartTimestamp(microtime(true) - $time / 1000);
$context->setEndTimestamp($context->getStartTimestamp() + $time / 1000);
Expand Down Expand Up @@ -327,7 +327,7 @@ protected function queueJobProcessingHandler(QueueEvents\JobProcessing $event)
$context->setName($resolvedJobName ?? $event->job->getName());
}

$context->setOp('queue.job');
$context->setOp('queue.process');
$context->setData($job);
$context->setStartTimestamp(microtime(true));

Expand Down
6 changes: 3 additions & 3 deletions src/Sentry/Laravel/Tracing/Middleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ private function startTransaction(Request $request, HubInterface $sentry): void
$bootstrapSpan = $this->addAppBootstrapSpan($request);

$appContextStart = new SpanContext();
$appContextStart->setOp('app.handle');
$appContextStart->setOp('laravel.handle');
$appContextStart->setStartTimestamp($bootstrapSpan ? $bootstrapSpan->getEndTimestamp() : microtime(true));

$this->appSpan = $this->transaction->startChild($appContextStart);
Expand All @@ -144,7 +144,7 @@ private function addAppBootstrapSpan(Request $request): ?Span
}

$spanContextStart = new SpanContext();
$spanContextStart->setOp('app.bootstrap');
$spanContextStart->setOp('laravel.bootstrap');
$spanContextStart->setStartTimestamp($laravelStartTime);
$spanContextStart->setEndTimestamp($this->bootedTimestamp);

Expand All @@ -168,7 +168,7 @@ private function addBootDetailTimeSpans(Span $bootstrap): void
}

$autoload = new SpanContext();
$autoload->setOp('autoload');
$autoload->setOp('laravel.autoload');
$autoload->setStartTimestamp($bootstrap->getStartTimestamp());
$autoload->setEndTimestamp(SENTRY_AUTOLOAD);

Expand Down
2 changes: 1 addition & 1 deletion src/Sentry/Laravel/Tracing/ViewEngineDecorator.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public function get($path, array $data = []): string
}

$context = new SpanContext();
$context->setOp('view.render');
$context->setOp('laravel.view');
$context->setDescription($this->viewFactory->shared(self::SHARED_KEY, basename($path)));

$span = $parentSpan->startChild($context);
Expand Down