Skip to content
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
8 changes: 4 additions & 4 deletions src/Sentry/Laravel/EventHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -281,10 +281,10 @@ private function addQueryBreadcrumb($query, $bindings, $time, $connectionName)
$transaction = SentrySdk::getCurrentHub()->getTransaction();
if (null !== $transaction) {
$context = new SpanContext();
$context->op = 'sql.query';
$context->description = $query;
$context->startTimestamp = microtime(true) - $time / 1000;
$context->endTimestamp = $context->startTimestamp + $time / 1000;
$context->setOp('sql.query');
$context->setDescription($query);
$context->setStartTimestamp(microtime(true) - $time / 1000);
$context->setEndTimestamp($context->getStartTimestamp() + $time / 1000);
$transaction->startChild($context);
}

Expand Down
28 changes: 14 additions & 14 deletions src/Sentry/Laravel/Tracing/Middleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,13 @@ private function startTransaction(Request $request, Hub $sentry): void
? TransactionContext::fromTraceparent($sentryTraceHeader)
: new TransactionContext;

$context->op = 'http.server';
$context->name = $path;
$context->data = [
$context->setOp('http.server');
$context->setName($path);
$context->setData([
'url' => $path,
'method' => strtoupper($request->method()),
];
$context->startTimestamp = $request->server('REQUEST_TIME_FLOAT', $fallbackTime);
]);
$context->setStartTimestamp($request->server('REQUEST_TIME_FLOAT', $fallbackTime));

$this->transaction = $sentry->startTransaction($context);

Expand All @@ -77,9 +77,9 @@ private function startTransaction(Request $request, Hub $sentry): void
// @TODO: We might want to move this together with the `RouteMatches` listener to some central place and or do this from the `EventHandler`
app()->booted(function () use ($request, $fallbackTime): void {
$spanContextStart = new SpanContext();
$spanContextStart->op = 'app.bootstrap';
$spanContextStart->startTimestamp = defined('LARAVEL_START') ? LARAVEL_START : $request->server('REQUEST_TIME_FLOAT', $fallbackTime);
$spanContextStart->endTimestamp = microtime(true);
$spanContextStart->setOp('app.bootstrap');
$spanContextStart->setStartTimestamp(defined('LARAVEL_START') ? LARAVEL_START : $request->server('REQUEST_TIME_FLOAT', $fallbackTime));
$spanContextStart->setEndTimestamp(microtime(true));
$this->transaction->startChild($spanContextStart);
});
}
Expand All @@ -100,15 +100,15 @@ private function addBootTimeSpans(): bool
}

$spanContextStart = new SpanContext();
$spanContextStart->op = 'autoload';
$spanContextStart->startTimestamp = LARAVEL_START;
$spanContextStart->endTimestamp = SENTRY_AUTOLOAD;
$spanContextStart->setOp('autoload');
$spanContextStart->setStartTimestamp(LARAVEL_START);
$spanContextStart->setEndTimestamp(SENTRY_AUTOLOAD);
$this->transaction->startChild($spanContextStart);

$spanContextStart = new SpanContext();
$spanContextStart->op = 'bootstrap';
$spanContextStart->startTimestamp = SENTRY_AUTOLOAD;
$spanContextStart->endTimestamp = SENTRY_BOOTSTRAP;
$spanContextStart->setOp('bootstrap');
$spanContextStart->setStartTimestamp(SENTRY_AUTOLOAD);
$spanContextStart->setEndTimestamp(SENTRY_BOOTSTRAP);
$this->transaction->startChild($spanContextStart);

return true;
Expand Down
4 changes: 2 additions & 2 deletions src/Sentry/Laravel/Tracing/ViewEngineDecorator.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ public function get($path, array $data = []): string
}

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

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

Expand Down