@@ -62,7 +62,7 @@ public function prepare($prepareString)
62
62
->addTag (new DbUser ($ this ->getUsername ()))
63
63
->addTag (new DbType ($ this ->getDatabasePlatform ()->getName ()))
64
64
->addTag (new DbalAutoCommitTag ($ this ->isAutoCommit ()))
65
- ->addTag (new DbStatementTag ($ prepareString ))
65
+ ->addTag (new DbStatementTag ($ this -> cutLongSql ( $ prepareString) ))
66
66
->addTag (new DbalNestingLevelTag ($ this ->getTransactionNestingLevel ()));
67
67
try {
68
68
return $ this ->wrappedPrepare ($ prepareString );
@@ -97,7 +97,7 @@ public function executeQuery($query, array $params = [], $types = [], QueryCache
97
97
->addTag (new DbUser ($ this ->getUsername ()))
98
98
->addTag (new DbType ($ this ->getDatabasePlatform ()->getName ()))
99
99
->addTag (new DbalAutoCommitTag ($ this ->isAutoCommit ()))
100
- ->addTag (new DbStatementTag ($ query ))
100
+ ->addTag (new DbStatementTag ($ this -> cutLongSql ( $ query) ))
101
101
->addTag (new DbalNestingLevelTag ($ this ->getTransactionNestingLevel ()));
102
102
try {
103
103
return parent ::executeQuery ($ query , $ params , $ types , $ qcp );
@@ -118,7 +118,7 @@ public function executeUpdate($query, array $params = [], array $types = [])
118
118
->addTag (new DbUser ($ this ->getUsername ()))
119
119
->addTag (new DbType ($ this ->getDatabasePlatform ()->getName ()))
120
120
->addTag (new DbalAutoCommitTag ($ this ->isAutoCommit ()))
121
- ->addTag (new DbStatementTag ($ query ))
121
+ ->addTag (new DbStatementTag ($ this -> cutLongSql ( $ query) ))
122
122
->addTag (new DbalNestingLevelTag ($ this ->getTransactionNestingLevel ()));
123
123
try {
124
124
return parent ::executeUpdate ($ query , $ params , $ types );
@@ -136,7 +136,7 @@ public function query()
136
136
$ args = func_get_args ();
137
137
$ span = $ this ->tracer
138
138
->start ('dbal.query ' )
139
- ->addTag (new DbStatementTag ($ args [0 ]))
139
+ ->addTag (new DbStatementTag ($ this -> cutLongSql ( $ args [0 ]) ))
140
140
->addTag (new DbInstanceTag ($ this ->getDatabase ()))
141
141
->addTag (new DbUser ($ this ->getUsername ()))
142
142
->addTag (new DbType ($ this ->getDatabasePlatform ()->getName ()))
@@ -232,4 +232,9 @@ public function rollBack()
232
232
$ this ->tracer ->finish ($ span ->addTag (new DbalNestingLevelTag ($ this ->getTransactionNestingLevel ())));
233
233
}
234
234
}
235
+
236
+ private function cutLongSql (string $ string ): string
237
+ {
238
+ return substr ($ string , 0 , 200 );
239
+ }
235
240
}
0 commit comments