diff --git a/src/Instrumentation/IO/README.md b/src/Instrumentation/IO/README.md index c63ceca6..8063e0d8 100644 --- a/src/Instrumentation/IO/README.md +++ b/src/Instrumentation/IO/README.md @@ -20,8 +20,6 @@ following functions: - `fread` - `file_get_contents` - `file_put_contents` -- `curl_init` -- `curl_exec` - `ob_start` - `ob_clean` - `ob_flush` diff --git a/src/Instrumentation/IO/src/IOInstrumentation.php b/src/Instrumentation/IO/src/IOInstrumentation.php index 04821991..30ce8243 100644 --- a/src/Instrumentation/IO/src/IOInstrumentation.php +++ b/src/Instrumentation/IO/src/IOInstrumentation.php @@ -39,8 +39,6 @@ public static function register(): void self::_hook($instrumentation, null, 'ob_flush', 'ob_flush'); self::_hook($instrumentation, null, 'flush', 'flush'); - self::_hook($instrumentation, null, 'curl_init', 'curl_init'); - self::_hook($instrumentation, null, 'curl_exec', 'curl_exec'); } /** @@ -102,10 +100,6 @@ private static function addParams(SpanBuilderInterface $builder, string $functio return; } switch ($function) { - case 'curl_init': - isset($params[0]) && $builder->setAttribute('code.params.uri', $params[0]); - - break; case 'fopen': $builder->setAttribute('code.params.filename', $params[0]) ->setAttribute('code.params.mode', $params[1]); diff --git a/src/Instrumentation/IO/tests/Integration/IOInstrumentationTest.php b/src/Instrumentation/IO/tests/Integration/IOInstrumentationTest.php index d23564c1..e9a8d625 100644 --- a/src/Instrumentation/IO/tests/Integration/IOInstrumentationTest.php +++ b/src/Instrumentation/IO/tests/Integration/IOInstrumentationTest.php @@ -5,7 +5,6 @@ namespace OpenTelemetry\Tests\Instrumentation\IO\tests\Integration; use ArrayObject; -use CurlHandle; use OpenTelemetry\API\Instrumentation\Configurator; use OpenTelemetry\Context\ScopeInterface; use OpenTelemetry\SDK\Trace\ImmutableSpan; @@ -75,17 +74,6 @@ public function test_io_calls(): void $this->span = $this->storage->offsetGet(4); $this->assertSame('fread', $this->span->getName()); - $ch = curl_init('foo'); - $this->assertInstanceOf(CurlHandle::class, $ch); - $this->assertCount(6, $this->storage); - $this->span = $this->storage->offsetGet(5); - $this->assertSame('curl_init', $this->span->getName()); - $this->assertSame('foo', $this->span->getAttributes()->get('code.params.uri')); - - curl_exec($ch); - $this->assertCount(7, $this->storage); - $this->span = $this->storage->offsetGet(6); - $this->assertSame('curl_exec', $this->span->getName()); } public function test_output_buffer_calls(): void