@@ -111,7 +111,7 @@ private function wrappedPrepare($sql): JaegerStatementWrapper
111
111
public function executeQuery (string $ sql , array $ params = [], $ types = [], ?QueryCacheProfile $ qcp = null ): Result
112
112
{
113
113
$ span = $ this ->tracer
114
- ->start ('dbal.execute ' )
114
+ ->start ('dbal.query ' )
115
115
->addTag (new DbType (get_class ($ this ->getDatabasePlatform ())))
116
116
->addTag (new DbalAutoCommitTag ($ this ->isAutoCommit ()))
117
117
->addTag (new DbStatementTag ($ this ->cutLongSql ($ sql )))
@@ -127,7 +127,7 @@ public function executeQuery(string $sql, array $params = [], $types = [], ?Quer
127
127
}
128
128
}
129
129
130
- public function executeUpdate ( string $ sql , array $ params = [], array $ types = []): int
130
+ public function executeStatement ( $ sql , array $ params = [], array $ types = [])
131
131
{
132
132
$ span = $ this ->tracer
133
133
->start ('dbal.execute ' )
@@ -136,47 +136,7 @@ public function executeUpdate(string $sql, array $params = [], array $types = []
136
136
->addTag (new DbStatementTag ($ this ->cutLongSql ($ sql )))
137
137
->addTag (new DbalNestingLevelTag ($ this ->getTransactionNestingLevel ()));
138
138
try {
139
- return parent ::executeUpdate ($ sql , $ params , $ types );
140
- } catch (\Exception $ e ) {
141
- $ span ->addTag (new DbalErrorCodeTag ($ e ->getCode ()))
142
- ->addTag (new ErrorTag ());
143
- throw $ e ;
144
- } finally {
145
- $ this ->tracer ->finish ($ span );
146
- }
147
- }
148
-
149
- public function query (string $ sql ): Result
150
- {
151
- $ span = $ this ->tracer
152
- ->start ('dbal.query ' )
153
- ->addTag (new DbStatementTag ($ this ->cutLongSql ($ sql )))
154
- ->addTag (new DbType (get_class ($ this ->getDatabasePlatform ())))
155
- ->addTag (new DbalAutoCommitTag ($ this ->isAutoCommit ()))
156
- ->addTag (new DbalNestingLevelTag ($ this ->getTransactionNestingLevel ()));
157
- try {
158
- return parent ::query ($ sql );
159
- } catch (\Exception $ e ) {
160
- $ span ->addTag (new DbalErrorCodeTag ($ e ->getCode ()))
161
- ->addTag (new ErrorTag ());
162
- throw $ e ;
163
- } finally {
164
- $ this ->tracer ->finish ($ span );
165
- }
166
- }
167
-
168
- public function exec (string $ sql ): int
169
- {
170
- $ span = $ this ->tracer
171
- ->start ('dbal.exec ' )
172
- ->addTag (new DbType (get_class ($ this ->getDatabasePlatform ())))
173
- ->addTag (new DbalAutoCommitTag ($ this ->isAutoCommit ()))
174
- ->addTag (new DbalNestingLevelTag ($ this ->getTransactionNestingLevel ()));
175
- try {
176
- $ rows = parent ::exec ($ sql );
177
- $ span ->addTag (new DbalRowNumberTag ($ rows ));
178
-
179
- return $ rows ;
139
+ return parent ::executeStatement ($ sql , $ params , $ types );
180
140
} catch (\Exception $ e ) {
181
141
$ span ->addTag (new DbalErrorCodeTag ($ e ->getCode ()))
182
142
->addTag (new ErrorTag ());
0 commit comments