From e6b22bb55ef987ae6fb253cc35d8b4c6d42b533e Mon Sep 17 00:00:00 2001 From: Michi Hoffmann Date: Fri, 30 Sep 2022 14:54:57 +0200 Subject: [PATCH] ref: Align Span Operations with new spec (#574) Co-authored-by: Alex Bouma --- CHANGELOG.md | 1 + src/Sentry/Laravel/Tracing/Middleware.php | 6 +++--- src/Sentry/Laravel/Tracing/ViewEngineDecorator.php | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 31af3d53..d42b9103 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ - Fix not listening to queue events because `QueueManager` is registered as `queue` in the container and not by it's class name (#568) - Fix status code not populated on transaction if response did not inherit from `Illuminate\Http\Response` like `Illuminate\Http\JsonResponse` (#573) +- Align Span Operations with new spec (#574) - Fix broken `SetRequestMiddleware` on Laravel < 6.0 (#575) ## 2.13.0 diff --git a/src/Sentry/Laravel/Tracing/Middleware.php b/src/Sentry/Laravel/Tracing/Middleware.php index e6b61468..24eb8341 100644 --- a/src/Sentry/Laravel/Tracing/Middleware.php +++ b/src/Sentry/Laravel/Tracing/Middleware.php @@ -123,7 +123,7 @@ private function startTransaction(Request $request, HubInterface $sentry): void $bootstrapSpan = $this->addAppBootstrapSpan($request); $appContextStart = new SpanContext(); - $appContextStart->setOp('laravel.handle'); + $appContextStart->setOp('middleware.handle'); $appContextStart->setStartTimestamp($bootstrapSpan ? $bootstrapSpan->getEndTimestamp() : microtime(true)); $this->appSpan = $this->transaction->startChild($appContextStart); @@ -144,7 +144,7 @@ private function addAppBootstrapSpan(Request $request): ?Span } $spanContextStart = new SpanContext(); - $spanContextStart->setOp('laravel.bootstrap'); + $spanContextStart->setOp('app.bootstrap'); $spanContextStart->setStartTimestamp($laravelStartTime); $spanContextStart->setEndTimestamp($this->bootedTimestamp); @@ -168,7 +168,7 @@ private function addBootDetailTimeSpans(Span $bootstrap): void } $autoload = new SpanContext(); - $autoload->setOp('laravel.autoload'); + $autoload->setOp('app.php.autoload'); $autoload->setStartTimestamp($bootstrap->getStartTimestamp()); $autoload->setEndTimestamp(SENTRY_AUTOLOAD); diff --git a/src/Sentry/Laravel/Tracing/ViewEngineDecorator.php b/src/Sentry/Laravel/Tracing/ViewEngineDecorator.php index f6e3abd1..79e262b5 100644 --- a/src/Sentry/Laravel/Tracing/ViewEngineDecorator.php +++ b/src/Sentry/Laravel/Tracing/ViewEngineDecorator.php @@ -36,7 +36,7 @@ public function get($path, array $data = []): string } $context = new SpanContext(); - $context->setOp('laravel.view'); + $context->setOp('view.render'); $context->setDescription($this->viewFactory->shared(self::SHARED_KEY, basename($path))); $span = $parentSpan->startChild($context);