Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion src/Instrumentation/CakePHP/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"ext-opentelemetry": "*",
"cakephp/cakephp": "^4 || ^5",
"open-telemetry/api": "^1.0",
"open-telemetry/sem-conv": "^1.30"
"open-telemetry/sem-conv": "^1.32"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^3",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public static function register(): void
$instrumentation = new CachedInstrumentation(
'io.opentelemetry.contrib.php.cakephp',
null,
'https://opentelemetry.io/schemas/1.30.0',
'https://opentelemetry.io/schemas/1.32.0',
);
Server::hook($instrumentation);
Controller::hook($instrumentation);
Expand Down
5 changes: 2 additions & 3 deletions src/Instrumentation/CakePHP/src/Hooks/CakeHookTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,8 @@ protected function buildSpan(?ServerRequestInterface $request, string $class, st
: sprintf('%s', $request?->getMethod() ?? 'unknown')
)
->setSpanKind(SpanKind::KIND_SERVER)
->setAttribute(TraceAttributes::CODE_FUNCTION_NAME, $function)
->setAttribute(TraceAttributes::CODE_NAMESPACE, $class)
->setAttribute(TraceAttributes::CODE_FILEPATH, $filename)
->setAttribute(TraceAttributes::CODE_FUNCTION_NAME, sprintf('%s::%s', $class, $function))
->setAttribute(TraceAttributes::CODE_FILE_PATH, $filename)
->setAttribute(TraceAttributes::CODE_LINE_NUMBER, $lineno);
$parent = Context::getCurrent();
if (!$root && $request) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public function test_index(): void
$this->assertSame(SpanKind::KIND_SERVER, $serverSpan->getKind());
$this->assertGreaterThan(0, $serverSpan->getAttributes()->count());
$attributes = $serverSpan->getAttributes()->toArray();
$this->assertSame('run', $attributes['code.function.name']);
$this->assertSame('Cake\Http\Server::run', $attributes['code.function.name']);
$this->assertSame('GET', $attributes['http.request.method']);
$this->assertSame(200, $attributes['http.response.status_code']);
$this->assertSame(self::TRACE_ID, $serverSpan->getParentContext()->getTraceId());
Expand All @@ -58,7 +58,7 @@ public function test_index(): void
$this->assertSame(SpanKind::KIND_INTERNAL, $controllerSpan->getKind());
$this->assertGreaterThan(0, $controllerSpan->getAttributes()->count());
$attributes = $controllerSpan->getAttributes()->toArray();
$this->assertSame('invokeAction', $attributes['code.function.name']);
$this->assertSame('Cake\Controller\Controller::invokeAction', $attributes['code.function.name']);
$this->assertSame($serverSpan->getTraceId(), $controllerSpan->getParentContext()->getTraceId());
$this->assertSame($serverSpan->getSpanId(), $controllerSpan->getParentContext()->getSpanId());
}
Expand Down
2 changes: 1 addition & 1 deletion src/Instrumentation/CodeIgniter/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"ext-opentelemetry": "*",
"codeigniter4/framework": "^4.3",
"open-telemetry/api": "^1.0",
"open-telemetry/sem-conv": "^1.30"
"open-telemetry/sem-conv": "^1.32"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^3.50",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public static function register(): void
$instrumentation = new CachedInstrumentation(
'io.opentelemetry.contrib.php.codeigniter',
null,
'https://opentelemetry.io/schemas/1.30.0',
'https://opentelemetry.io/schemas/1.32.0',
);

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

$parent = Context::getCurrent();
Expand Down
2 changes: 1 addition & 1 deletion src/Instrumentation/Curl/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"ext-curl": "*",
"ext-opentelemetry": "*",
"open-telemetry/api": "^1.0",
"open-telemetry/sem-conv": "^1.30"
"open-telemetry/sem-conv": "^1.32"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^3",
Expand Down
4 changes: 2 additions & 2 deletions src/Instrumentation/Curl/src/CurlInstrumentation.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public static function register(): void
$instrumentation = new CachedInstrumentation(
'io.opentelemetry.contrib.php.curl',
null,
Version::VERSION_1_30_0->url(),
Version::VERSION_1_32_0->url(),
);

hook(
Expand Down Expand Up @@ -156,7 +156,7 @@ public static function register(): void
->setParent($parent)
->setSpanKind(SpanKind::KIND_CLIENT)
->setAttribute(TraceAttributes::CODE_FUNCTION_NAME, $function)
->setAttribute(TraceAttributes::CODE_FILEPATH, $filename)
->setAttribute(TraceAttributes::CODE_FILE_PATH, $filename)
->setAttribute(TraceAttributes::CODE_LINE_NUMBER, $lineno)
->setAttributes($curlHandleToAttributes[$params[0]]->getAttributes());

Expand Down
Loading
Loading