@@ -25,6 +25,7 @@ SPDX-License-Identifier: Apache-2.0
25
25
</tracerFactory >
26
26
27
27
28
+ <!-- NOTE: Only put non-async instrumentation points in this tracerFactory, async methods go in SqlCommandTracerAsync (below) -->
28
29
<tracerFactory name =" SqlCommandTracer" >
29
30
30
31
<!-- built in MS SQL driver (framework) -->
@@ -83,8 +84,9 @@ SPDX-License-Identifier: Apache-2.0
83
84
<exactMethodMatcher methodName =" ExecuteNonQuery" />
84
85
</match >
85
86
86
- <!-- MySql (official) driver -->
87
- <match assemblyName =" MySql.Data" className =" MySql.Data.MySqlClient.MySqlCommand" >
87
+ <!-- MySql (official) driver-->
88
+ <!-- Starting in 8.0.33 the non-async methods are just passthroughs to async methods which are instrumented in the SqlCommandTracerAsync factory -->
89
+ <match assemblyName =" MySql.Data" className =" MySql.Data.MySqlClient.MySqlCommand" maxVersion =" 8.0.33" >
88
90
<exactMethodMatcher methodName =" ExecuteReader" parameters =" System.Data.CommandBehavior" />
89
91
<exactMethodMatcher methodName =" ExecuteNonQuery" />
90
92
</match >
@@ -130,6 +132,7 @@ SPDX-License-Identifier: Apache-2.0
130
132
</match >
131
133
</tracerFactory >
132
134
135
+ <!-- NOTE: Only put async instrumentation points in this tracerFactory, non-async methods go in SqlCommandTracer (above) -->
133
136
<tracerFactory name =" SqlCommandTracerAsync" >
134
137
135
138
<!-- built in MS SQL driver (framework) -->
@@ -159,6 +162,13 @@ SPDX-License-Identifier: Apache-2.0
159
162
<exactMethodMatcher methodName =" ExecuteXmlReaderAsync" parameters =" System.Threading.CancellationToken" />
160
163
</match >
161
164
165
+ <!-- MySql (official) driver-->
166
+ <!-- Prior to 8.0.33 we instrument non-async methods in the SqlCommandTracer factory above -->
167
+ <match assemblyName =" MySql.Data" className =" MySql.Data.MySqlClient.MySqlCommand" minVersion =" 8.0.33" >
168
+ <exactMethodMatcher methodName =" ExecuteReaderAsync" parameters =" System.Data.CommandBehavior,System.Boolean,System.Threading.CancellationToken" />
169
+ <exactMethodMatcher methodName =" ExecuteNonQueryAsync" parameters =" System.Boolean,System.Threading.CancellationToken" />
170
+ </match >
171
+
162
172
<!-- MySqlConnector 0.x -->
163
173
<match assemblyName =" MySqlConnector" className =" MySql.Data.MySqlClient.MySqlCommand" >
164
174
<exactMethodMatcher methodName =" ExecuteDbDataReaderAsync" parameters =" System.Data.CommandBehavior,System.Threading.CancellationToken" />
@@ -189,6 +199,7 @@ SPDX-License-Identifier: Apache-2.0
189
199
</tracerFactory >
190
200
191
201
<!-- DataReader methods. DISABLED by default due to possible performance impact. Set enabled to "true" (or omit completely) to enable this instrumentation. -->
202
+ <!-- NOTE: this tracer factory is for non-async method instrumentation only. For async methods, use the DataReaderTracerAsync factory below -->
192
203
<tracerFactory name =" DataReaderTracer" enabled =" false" >
193
204
<!-- built in MS SQL driver (framework) -->
194
205
<match assemblyName =" System.Data" className =" System.Data.SqlClient.SqlDataReader" >
@@ -227,7 +238,8 @@ SPDX-License-Identifier: Apache-2.0
227
238
</match >
228
239
229
240
<!-- MySql (official) driver -->
230
- <match assemblyName =" MySql.Data" className =" MySql.Data.MySqlClient.MySqlDataReader" >
241
+ <!-- In version 8.0.33 these methods became async and are instrumented in the DataReaderTracerAsync factory below -->
242
+ <match assemblyName =" MySql.Data" className =" MySql.Data.MySqlClient.MySqlDataReader" maxVersion =" 8.0.33" >
231
243
<exactMethodMatcher methodName =" NextResult" />
232
244
<exactMethodMatcher methodName =" Read" />
233
245
</match >
@@ -266,6 +278,7 @@ SPDX-License-Identifier: Apache-2.0
266
278
</match >
267
279
</tracerFactory >
268
280
281
+ <!-- NOTE: this tracer factory is for async method instrumentation only. For non-async methods, use the DataReaderTracer factory above -->
269
282
<tracerFactory name =" DataReaderTracerAsync" enabled =" false" >
270
283
<!-- built in MS SQL driver (framework) -->
271
284
<match assemblyName =" System.Data" className =" System.Data.SqlClient.SqlDataReader" >
@@ -284,6 +297,12 @@ SPDX-License-Identifier: Apache-2.0
284
297
<exactMethodMatcher methodName =" ReadAsync" />
285
298
</match >
286
299
300
+ <!-- Prior to version 8.0.33 these methods were synchroous and are instrumented in the DataReaderTracer factory above -->
301
+ <match assemblyName =" MySql.Data" className =" MySql.Data.MySqlClient.MySqlDataReader" minVersion =" 8.0.33" >
302
+ <exactMethodMatcher methodName =" NextResultAsync" parameters =" System.Boolean,System.Threading.CancellationToken" />
303
+ <exactMethodMatcher methodName =" ReadAsync" parameters =" System.Boolean,System.Threading.CancellationToken" />
304
+ </match >
305
+
287
306
<!-- MySqlConnector 0.x -->
288
307
<match assemblyName =" MySqlConnector" className =" MySql.Data.MySqlClient.MySqlDataReader" >
289
308
<exactMethodMatcher methodName =" NextResultAsync" />
0 commit comments