Skip to content

Commit aa40cf5

Browse files
authored
Merge branch 'open-telemetry:main' into react-http
2 parents ca9221f + e728534 commit aa40cf5

File tree

71 files changed

+559
-210
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+559
-210
lines changed

src/Instrumentation/CakePHP/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"ext-opentelemetry": "*",
1414
"cakephp/cakephp": "^4 || ^5",
1515
"open-telemetry/api": "^1.0",
16-
"open-telemetry/sem-conv": "^1.30"
16+
"open-telemetry/sem-conv": "^1.32"
1717
},
1818
"require-dev": {
1919
"friendsofphp/php-cs-fixer": "^3",

src/Instrumentation/CakePHP/src/CakePHPInstrumentation.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public static function register(): void
1818
$instrumentation = new CachedInstrumentation(
1919
'io.opentelemetry.contrib.php.cakephp',
2020
null,
21-
'https://opentelemetry.io/schemas/1.30.0',
21+
'https://opentelemetry.io/schemas/1.32.0',
2222
);
2323
Server::hook($instrumentation);
2424
Controller::hook($instrumentation);

src/Instrumentation/CakePHP/src/Hooks/CakeHookTrait.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,8 @@ protected function buildSpan(?ServerRequestInterface $request, string $class, st
5757
: sprintf('%s', $request?->getMethod() ?? 'unknown')
5858
)
5959
->setSpanKind(SpanKind::KIND_SERVER)
60-
->setAttribute(TraceAttributes::CODE_FUNCTION_NAME, $function)
61-
->setAttribute(TraceAttributes::CODE_NAMESPACE, $class)
62-
->setAttribute(TraceAttributes::CODE_FILEPATH, $filename)
60+
->setAttribute(TraceAttributes::CODE_FUNCTION_NAME, sprintf('%s::%s', $class, $function))
61+
->setAttribute(TraceAttributes::CODE_FILE_PATH, $filename)
6362
->setAttribute(TraceAttributes::CODE_LINE_NUMBER, $lineno);
6463
$parent = Context::getCurrent();
6564
if (!$root && $request) {

src/Instrumentation/CakePHP/tests/Integration/CakePHPInstrumentationTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public function test_index(): void
4545
$this->assertSame(SpanKind::KIND_SERVER, $serverSpan->getKind());
4646
$this->assertGreaterThan(0, $serverSpan->getAttributes()->count());
4747
$attributes = $serverSpan->getAttributes()->toArray();
48-
$this->assertSame('run', $attributes['code.function.name']);
48+
$this->assertSame('Cake\Http\Server::run', $attributes['code.function.name']);
4949
$this->assertSame('GET', $attributes['http.request.method']);
5050
$this->assertSame(200, $attributes['http.response.status_code']);
5151
$this->assertSame(self::TRACE_ID, $serverSpan->getParentContext()->getTraceId());
@@ -58,7 +58,7 @@ public function test_index(): void
5858
$this->assertSame(SpanKind::KIND_INTERNAL, $controllerSpan->getKind());
5959
$this->assertGreaterThan(0, $controllerSpan->getAttributes()->count());
6060
$attributes = $controllerSpan->getAttributes()->toArray();
61-
$this->assertSame('invokeAction', $attributes['code.function.name']);
61+
$this->assertSame('Cake\Controller\Controller::invokeAction', $attributes['code.function.name']);
6262
$this->assertSame($serverSpan->getTraceId(), $controllerSpan->getParentContext()->getTraceId());
6363
$this->assertSame($serverSpan->getSpanId(), $controllerSpan->getParentContext()->getSpanId());
6464
}

src/Instrumentation/CodeIgniter/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"ext-opentelemetry": "*",
1414
"codeigniter4/framework": "^4.3",
1515
"open-telemetry/api": "^1.0",
16-
"open-telemetry/sem-conv": "^1.30"
16+
"open-telemetry/sem-conv": "^1.32"
1717
},
1818
"require-dev": {
1919
"friendsofphp/php-cs-fixer": "^3.50",

src/Instrumentation/CodeIgniter/src/CodeIgniterInstrumentation.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public static function register(): void
2727
$instrumentation = new CachedInstrumentation(
2828
'io.opentelemetry.contrib.php.codeigniter',
2929
null,
30-
'https://opentelemetry.io/schemas/1.30.0',
30+
'https://opentelemetry.io/schemas/1.32.0',
3131
);
3232

3333
// The method that creates request/response/controller objects is in the same class as the method
@@ -65,9 +65,8 @@ public static function register(): void
6565
/** @phan-suppress-next-line PhanDeprecatedFunction */
6666
->spanBuilder(\sprintf('%s', $request?->getMethod() ?? 'unknown'))
6767
->setSpanKind(SpanKind::KIND_SERVER)
68-
->setAttribute(TraceAttributes::CODE_FUNCTION_NAME, $function)
69-
->setAttribute(TraceAttributes::CODE_NAMESPACE, $class)
70-
->setAttribute(TraceAttributes::CODE_FILEPATH, $filename)
68+
->setAttribute(TraceAttributes::CODE_FUNCTION_NAME, sprintf('%s::%s', $class, $function))
69+
->setAttribute(TraceAttributes::CODE_FILE_PATH, $filename)
7170
->setAttribute(TraceAttributes::CODE_LINE_NUMBER, $lineno);
7271

7372
$parent = Context::getCurrent();

src/Instrumentation/Curl/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"ext-curl": "*",
2121
"ext-opentelemetry": "*",
2222
"open-telemetry/api": "^1.0",
23-
"open-telemetry/sem-conv": "^1.30"
23+
"open-telemetry/sem-conv": "^1.32"
2424
},
2525
"require-dev": {
2626
"friendsofphp/php-cs-fixer": "^3",

src/Instrumentation/Curl/src/CurlInstrumentation.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public static function register(): void
4646
$instrumentation = new CachedInstrumentation(
4747
'io.opentelemetry.contrib.php.curl',
4848
null,
49-
Version::VERSION_1_30_0->url(),
49+
Version::VERSION_1_32_0->url(),
5050
);
5151

5252
hook(
@@ -156,7 +156,7 @@ public static function register(): void
156156
->setParent($parent)
157157
->setSpanKind(SpanKind::KIND_CLIENT)
158158
->setAttribute(TraceAttributes::CODE_FUNCTION_NAME, $function)
159-
->setAttribute(TraceAttributes::CODE_FILEPATH, $filename)
159+
->setAttribute(TraceAttributes::CODE_FILE_PATH, $filename)
160160
->setAttribute(TraceAttributes::CODE_LINE_NUMBER, $lineno)
161161
->setAttributes($curlHandleToAttributes[$params[0]]->getAttributes());
162162

0 commit comments

Comments
 (0)