@@ -62,7 +62,7 @@ public function prepare($prepareString)
6262 ->addTag (new DbUser ($ this ->getUsername ()))
6363 ->addTag (new DbType ($ this ->getDatabasePlatform ()->getName ()))
6464 ->addTag (new DbalAutoCommitTag ($ this ->isAutoCommit ()))
65- ->addTag (new DbStatementTag ($ prepareString ))
65+ ->addTag (new DbStatementTag ($ this -> cutLongSql ( $ prepareString) ))
6666 ->addTag (new DbalNestingLevelTag ($ this ->getTransactionNestingLevel ()));
6767 try {
6868 return $ this ->wrappedPrepare ($ prepareString );
@@ -97,7 +97,7 @@ public function executeQuery($query, array $params = [], $types = [], QueryCache
9797 ->addTag (new DbUser ($ this ->getUsername ()))
9898 ->addTag (new DbType ($ this ->getDatabasePlatform ()->getName ()))
9999 ->addTag (new DbalAutoCommitTag ($ this ->isAutoCommit ()))
100- ->addTag (new DbStatementTag ($ query ))
100+ ->addTag (new DbStatementTag ($ this -> cutLongSql ( $ query) ))
101101 ->addTag (new DbalNestingLevelTag ($ this ->getTransactionNestingLevel ()));
102102 try {
103103 return parent ::executeQuery ($ query , $ params , $ types , $ qcp );
@@ -118,7 +118,7 @@ public function executeUpdate($query, array $params = [], array $types = [])
118118 ->addTag (new DbUser ($ this ->getUsername ()))
119119 ->addTag (new DbType ($ this ->getDatabasePlatform ()->getName ()))
120120 ->addTag (new DbalAutoCommitTag ($ this ->isAutoCommit ()))
121- ->addTag (new DbStatementTag ($ query ))
121+ ->addTag (new DbStatementTag ($ this -> cutLongSql ( $ query) ))
122122 ->addTag (new DbalNestingLevelTag ($ this ->getTransactionNestingLevel ()));
123123 try {
124124 return parent ::executeUpdate ($ query , $ params , $ types );
@@ -136,7 +136,7 @@ public function query()
136136 $ args = func_get_args ();
137137 $ span = $ this ->tracer
138138 ->start ('dbal.query ' )
139- ->addTag (new DbStatementTag ($ args [0 ]))
139+ ->addTag (new DbStatementTag ($ this -> cutLongSql ( $ args [0 ]) ))
140140 ->addTag (new DbInstanceTag ($ this ->getDatabase ()))
141141 ->addTag (new DbUser ($ this ->getUsername ()))
142142 ->addTag (new DbType ($ this ->getDatabasePlatform ()->getName ()))
@@ -232,4 +232,9 @@ public function rollBack()
232232 $ this ->tracer ->finish ($ span ->addTag (new DbalNestingLevelTag ($ this ->getTransactionNestingLevel ())));
233233 }
234234 }
235+
236+ private function cutLongSql (string $ string ): string
237+ {
238+ return substr ($ string , 0 , 200 );
239+ }
235240}
0 commit comments