Skip to content

Commit ddbe719

Browse files
authored
Update tracing operation names (#533)
1 parent 1a8f7b5 commit ddbe719

File tree

4 files changed

+7
-6
lines changed

4 files changed

+7
-6
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
- Add support for Laravel 9 (#534)
66
- 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)
7+
- Update span operation names to match what Sentry server is expecting (#533)
78

89
## 2.10.2
910

src/Sentry/Laravel/Tracing/EventHandler.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ private function recordQuerySpan($query, $time): void
239239
}
240240

241241
$context = new SpanContext();
242-
$context->setOp('sql.query');
242+
$context->setOp('db.sql.query');
243243
$context->setDescription($query);
244244
$context->setStartTimestamp(microtime(true) - $time / 1000);
245245
$context->setEndTimestamp($context->getStartTimestamp() + $time / 1000);
@@ -327,7 +327,7 @@ protected function queueJobProcessingHandler(QueueEvents\JobProcessing $event)
327327
$context->setName($resolvedJobName ?? $event->job->getName());
328328
}
329329

330-
$context->setOp('queue.job');
330+
$context->setOp('queue.process');
331331
$context->setData($job);
332332
$context->setStartTimestamp(microtime(true));
333333

src/Sentry/Laravel/Tracing/Middleware.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ private function startTransaction(Request $request, HubInterface $sentry): void
123123
$bootstrapSpan = $this->addAppBootstrapSpan($request);
124124

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

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

146146
$spanContextStart = new SpanContext();
147-
$spanContextStart->setOp('app.bootstrap');
147+
$spanContextStart->setOp('laravel.bootstrap');
148148
$spanContextStart->setStartTimestamp($laravelStartTime);
149149
$spanContextStart->setEndTimestamp($this->bootedTimestamp);
150150

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

170170
$autoload = new SpanContext();
171-
$autoload->setOp('autoload');
171+
$autoload->setOp('laravel.autoload');
172172
$autoload->setStartTimestamp($bootstrap->getStartTimestamp());
173173
$autoload->setEndTimestamp(SENTRY_AUTOLOAD);
174174

src/Sentry/Laravel/Tracing/ViewEngineDecorator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public function get($path, array $data = []): string
3636
}
3737

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

4242
$span = $parentSpan->startChild($context);

0 commit comments

Comments
 (0)