Skip to content
Merged
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
9 changes: 4 additions & 5 deletions src/Instrumentation/Curl/src/CurlInstrumentation.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
use OpenTelemetry\SemConv\TraceAttributes;
use OpenTelemetry\SemConv\Version;
use WeakMap;
use WeakReference;

class CurlInstrumentation
{
Expand All @@ -35,7 +34,7 @@ public static function register(): void
* 'handles'=>
* WeakMap[CurlHandle] => {
* 'finished' => bool,
* 'span' => WeakReference<SpanInterface>
* 'span' => SpanInterface
* }
* )
*/
Expand Down Expand Up @@ -327,7 +326,7 @@ public static function register(): void
}
$curlSetOptInstrumentationSuppressed = false;

$metadata['span'] = WeakReference::create($span);
$metadata['span'] = $span;
}
$mHandle['started'] = true;
}
Expand All @@ -339,7 +338,7 @@ public static function register(): void
foreach ($handles as $cHandle => &$metadata) {
if ($metadata['finished'] == false) {
$metadata['finished'] = true;
self::finishMultiSpan(CURLE_OK, $cHandle, $curlHandleToAttributes, $metadata['span']?->get()); // there is no way to get information if it was OK or not without calling curl_multi_info_read
self::finishMultiSpan(CURLE_OK, $cHandle, $curlHandleToAttributes, $metadata['span']); // there is no way to get information if it was OK or not without calling curl_multi_info_read
}
}

Expand Down Expand Up @@ -379,7 +378,7 @@ public static function register(): void

/** @psalm-suppress PossiblyNullArrayAccess */
$currentHandle['finished'] = true;
self::finishMultiSpan($retVal['result'], $retVal['handle'], $curlHandleToAttributes, $currentHandle['span']?->get());
self::finishMultiSpan($retVal['result'], $retVal['handle'], $curlHandleToAttributes, $currentHandle['span']);
}
}
}
Expand Down
Loading