Skip to content

Commit 312faa1

Browse files
committed
Move $scheme before install_hook
1 parent c3c7673 commit 312faa1

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/Integrations/Integrations/Swoole/SwooleIntegration.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,11 @@ public function requiresExplicitTraceAnalyticsEnabling()
3333

3434
public function instrumentRequestStart(callable $callback, SwooleIntegration $integration, Server $server)
3535
{
36+
$scheme = $server->ssl ? 'https://' : 'http://';
37+
3638
\DDTrace\install_hook(
3739
$callback,
38-
function (HookData $hook) use ($integration, $server) {
40+
function (HookData $hook) use ($integration, $server, $scheme) {
3941
$rootSpan = $hook->span(new SpanStack());
4042
$rootSpan->name = "web.request";
4143
$rootSpan->service = \ddtrace_config_app_name('swoole');
@@ -97,7 +99,6 @@ function (HookData $hook) use ($integration, $server) {
9799
$rootSpan->resource = $request->server['request_method'] . ' ' . $normalizedPath;
98100
$rootSpan->meta[Tag::HTTP_METHOD] = $request->server['request_method'];
99101

100-
$scheme = $server->ssl ? 'https://' : 'http://';
101102
$host = $headers['host'] ?? ($request->server['remote_addr'] . ':' . $request->server['server_port']);
102103
$path = $request->server['request_uri'] ?? $request->server['path_info'] ?? '';
103104
$query = isset($request->server['query_string']) ? '?' . $request->server['query_string'] : '';

0 commit comments

Comments
 (0)