Skip to content

Commit 0e5a858

Browse files
Remove curl hooks from IO contrib package (#441)
1 parent 7cbfcda commit 0e5a858

File tree

3 files changed

+0
-20
lines changed

3 files changed

+0
-20
lines changed

src/Instrumentation/IO/README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ following functions:
2020
- `fread`
2121
- `file_get_contents`
2222
- `file_put_contents`
23-
- `curl_init`
24-
- `curl_exec`
2523
- `ob_start`
2624
- `ob_clean`
2725
- `ob_flush`

src/Instrumentation/IO/src/IOInstrumentation.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,6 @@ public static function register(): void
3939
self::_hook($instrumentation, null, 'ob_flush', 'ob_flush');
4040
self::_hook($instrumentation, null, 'flush', 'flush');
4141

42-
self::_hook($instrumentation, null, 'curl_init', 'curl_init');
43-
self::_hook($instrumentation, null, 'curl_exec', 'curl_exec');
4442
}
4543

4644
/**
@@ -102,10 +100,6 @@ private static function addParams(SpanBuilderInterface $builder, string $functio
102100
return;
103101
}
104102
switch ($function) {
105-
case 'curl_init':
106-
isset($params[0]) && $builder->setAttribute('code.params.uri', $params[0]);
107-
108-
break;
109103
case 'fopen':
110104
$builder->setAttribute('code.params.filename', $params[0])
111105
->setAttribute('code.params.mode', $params[1]);

src/Instrumentation/IO/tests/Integration/IOInstrumentationTest.php

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
namespace OpenTelemetry\Tests\Instrumentation\IO\tests\Integration;
66

77
use ArrayObject;
8-
use CurlHandle;
98
use OpenTelemetry\API\Instrumentation\Configurator;
109
use OpenTelemetry\Context\ScopeInterface;
1110
use OpenTelemetry\SDK\Trace\ImmutableSpan;
@@ -75,17 +74,6 @@ public function test_io_calls(): void
7574
$this->span = $this->storage->offsetGet(4);
7675
$this->assertSame('fread', $this->span->getName());
7776

78-
$ch = curl_init('foo');
79-
$this->assertInstanceOf(CurlHandle::class, $ch);
80-
$this->assertCount(6, $this->storage);
81-
$this->span = $this->storage->offsetGet(5);
82-
$this->assertSame('curl_init', $this->span->getName());
83-
$this->assertSame('foo', $this->span->getAttributes()->get('code.params.uri'));
84-
85-
curl_exec($ch);
86-
$this->assertCount(7, $this->storage);
87-
$this->span = $this->storage->offsetGet(6);
88-
$this->assertSame('curl_exec', $this->span->getName());
8977
}
9078

9179
public function test_output_buffer_calls(): void

0 commit comments

Comments
 (0)