Skip to content

Commit 5e55dcb

Browse files
authored
fix db name attribute (#275)
1 parent c937e29 commit 5e55dcb

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

examples/instrumentation/Wordpress/composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
"type": "project",
55
"minimum-stability": "beta",
66
"require": {
7-
"open-telemetry/opentelemetry-auto-wordpress": "^0.0.5",
8-
"open-telemetry/sdk": "^1.0@beta",
9-
"open-telemetry/exporter-otlp": "^1.0@beta",
7+
"open-telemetry/opentelemetry-auto-wordpress": "^0.0.15",
8+
"open-telemetry/sdk": "^1.0",
9+
"open-telemetry/exporter-otlp": "^1.0",
1010
"php-http/guzzle7-adapter": "^1.0"
1111
},
1212
"config": {

src/Instrumentation/Wordpress/src/WordpressInstrumentation.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ function: '__construct',
4949
pre: static function ($object, ?array $params, ?string $class, ?string $function, ?string $filename, ?int $lineno) use ($instrumentation) {
5050
$span = self::builder($instrumentation, 'wpdb.__connect', $function, $class, $filename, $lineno)
5151
->setAttribute(TraceAttributes::DB_USER, $params[0] ?? 'unknown')
52-
->setAttribute(TraceAttributes::DB_NAME, $params[1] ?? 'unknown')
52+
->setAttribute(TraceAttributes::DB_NAME, $params[2] ?? 'unknown')
5353
->setAttribute(TraceAttributes::DB_SYSTEM, 'mysql')
5454
->startSpan();
5555
Context::storage()->attach($span->storeInContext(Context::getCurrent()));

0 commit comments

Comments
 (0)