Skip to content

Commit 14e84a0

Browse files
committed
Updated
1 parent 18b6ec5 commit 14e84a0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Instrumentation/PDO/src/PDOInstrumentation.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ public static function register(): void
123123

124124
Context::storage()->attach($span->storeInContext($parent));
125125
if (self::isSqlCommenterEnabled() && $sqlStatement !== 'undefined') {
126-
$sqlStatement = self::appendSqlComments($sqlStatement);
126+
$sqlStatement = self::appendSqlComments($sqlStatement, true);
127127
$span->setAttributes([
128128
TraceAttributes::DB_QUERY_TEXT => $sqlStatement,
129129
]);
@@ -159,7 +159,7 @@ public static function register(): void
159159

160160
Context::storage()->attach($span->storeInContext($parent));
161161
if (self::isSqlCommenterEnabled() && $sqlStatement !== 'undefined') {
162-
$sqlStatement = self::appendSqlComments($sqlStatement);
162+
$sqlStatement = self::appendSqlComments($sqlStatement, true);
163163
$span->setAttributes([
164164
TraceAttributes::DB_QUERY_TEXT => $sqlStatement,
165165
]);
@@ -378,7 +378,7 @@ private static function isSqlCommenterEnabled(): bool
378378
return filter_var(get_cfg_var('otel.instrumentation.pdo.sql_commenter'), FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE) ?? false;
379379
}
380380

381-
private static function appendSqlComments(string $query, bool $withTraceContext = true): string
381+
private static function appendSqlComments(string $query, bool $withTraceContext): string
382382
{
383383
$comments = [];
384384
if ($withTraceContext) {

0 commit comments

Comments
 (0)