<?xml version="1.0" encoding="utf-8" ?>
<!--
Copyright 2020 New Relic Corporation. All rights reserved.
SPDX-License-Identifier: Apache-2.0
-->
<extension xmlns="urn:newrelic-extension">
  <instrumentation>

    <tracerFactory name="OdbcCommandTracer">
      <!-- built in ODBC driver -->
      <match assemblyName="System.Data" className="System.Data.Odbc.OdbcCommand">
        <exactMethodMatcher methodName="ExecuteReader" parameters="System.Data.CommandBehavior" />
        <exactMethodMatcher methodName="ExecuteNonQuery" />
        <exactMethodMatcher methodName="ExecuteScalar" />
      </match>

      <!-- .NET Core ODBC driver -->
      <match assemblyName="System.Data.Odbc" className="System.Data.Odbc.OdbcCommand">
        <exactMethodMatcher methodName="ExecuteReader" parameters="System.Data.CommandBehavior" />
        <exactMethodMatcher methodName="ExecuteNonQuery" />
        <exactMethodMatcher methodName="ExecuteScalar" />
      </match>
    </tracerFactory>

    <tracerFactory name="OleDbCommandTracer">
      <!-- built in ODBC driver -->
      <match assemblyName="System.Data" className="System.Data.OleDb.OleDbCommand">
        <exactMethodMatcher methodName="ExecuteReader" parameters="System.Data.CommandBehavior" />
        <exactMethodMatcher methodName="ExecuteNonQuery" />
        <exactMethodMatcher methodName="ExecuteScalar" />
      </match>
    </tracerFactory>


    <!-- NOTE: Only put non-async instrumentation points in this tracerFactory, async methods go in SqlCommandTracerAsync (below) -->
    <tracerFactory name="SqlCommandTracer">

      <!-- built in MS SQL driver (framework) -->
      <match assemblyName="System.Data" className="System.Data.SqlClient.SqlCommand">
        <exactMethodMatcher methodName="ExecuteReader" parameters="System.Data.CommandBehavior,System.String" />
        <exactMethodMatcher methodName="ExecuteNonQuery" />
        <exactMethodMatcher methodName="ExecuteScalar" />
        <exactMethodMatcher methodName="ExecuteXmlReader" />
      </match>

      <!-- built in MS SQL driver (core / nuget) -->
      <match assemblyName="System.Data.SqlClient" className="System.Data.SqlClient.SqlCommand">
        <exactMethodMatcher methodName="ExecuteReader" parameters="System.Data.CommandBehavior" />
        <exactMethodMatcher methodName="ExecuteNonQuery" />
        <exactMethodMatcher methodName="ExecuteScalar" />
        <exactMethodMatcher methodName="ExecuteXmlReader" />
      </match>

      <!-- MS SQL flagship data access driver (core & framework via nuget) -->
      <match assemblyName="Microsoft.Data.SqlClient" className="Microsoft.Data.SqlClient.SqlCommand">
        <!-- This form of ExecuteReader works for the .NET Core/Platform implementation -->
        <exactMethodMatcher methodName="ExecuteReader" parameters="System.Data.CommandBehavior" />
        <!-- This form of ExecuteReader works for the .NET Framework implementation -->
        <exactMethodMatcher methodName="ExecuteReader" parameters="System.Data.CommandBehavior,System.String" />
        <exactMethodMatcher methodName="ExecuteNonQuery" />
        <exactMethodMatcher methodName="ExecuteScalar" />
        <exactMethodMatcher methodName="ExecuteXmlReader" />
      </match>

      <!-- built in deprecated Oracle driver -->
      <match assemblyName="System.Data.OracleClient" className="System.Data.OracleClient.OracleCommand">
        <exactMethodMatcher methodName="ExecuteReader" parameters="System.Data.CommandBehavior" />
        <exactMethodMatcher methodName="ExecuteNonQuery" />
        <exactMethodMatcher methodName="ExecuteScalar" />
      </match>

      <!-- Oracle vendor driver -->
      <match assemblyName="Oracle.DataAccess" className="Oracle.DataAccess.Client.OracleCommand">
        <exactMethodMatcher methodName="ExecuteReader" parameters="System.Boolean,System.Boolean,System.Data.CommandBehavior" />
        <exactMethodMatcher methodName="ExecuteNonQuery" />
        <exactMethodMatcher methodName="ExecuteScalar" />
        <exactMethodMatcher methodName="ExecuteXmlReader" />
      </match>

      <!-- Oracle vendor driver for ManagedDataAccess packages targeting net462 -->
      <match assemblyName="Oracle.ManagedDataAccess" className="Oracle.ManagedDataAccess.Client.OracleCommand" maxVersion="4.122.23">
        <exactMethodMatcher methodName="ExecuteReader" parameters="System.Boolean,System.Boolean,System.Data.CommandBehavior" />
        <exactMethodMatcher methodName="ExecuteNonQuery" />
        <exactMethodMatcher methodName="ExecuteScalar" />
        <exactMethodMatcher methodName="ExecuteXmlReader" />
      </match>

      <!-- Oracle vendor driver for ManagedDataAccess.Core packages targeting net6.0 and later (yes, they use the same assembly name for core and fw) -->
      <match assemblyName="Oracle.ManagedDataAccess" className="Oracle.ManagedDataAccess.Client.OracleCommand" minVersion="23.0.0">
        <exactMethodMatcher methodName="ExecuteReaderInternal" parameters="System.Boolean,System.Boolean,System.Data.CommandBehavior,System.Boolean" />
        <exactMethodMatcher methodName="ExecuteNonQuery" />
        <exactMethodMatcher methodName="ExecuteScalar" />
        <exactMethodMatcher methodName="ExecuteXmlReader" />
      </match>

      <!-- Oracle vendor driver for ManagedDataAccess packages targeting net472+ -->
      <match assemblyName="Oracle.ManagedDataAccess" className="Oracle.ManagedDataAccess.Client.OracleCommand" minVersion="4.122.23">
        <exactMethodMatcher methodName="ExecuteReaderInternal" parameters="System.Boolean,System.Boolean,System.Data.CommandBehavior,System.Boolean" />
        <exactMethodMatcher methodName="ExecuteNonQuery" />
        <exactMethodMatcher methodName="ExecuteScalar" />
        <exactMethodMatcher methodName="ExecuteXmlReader" />
      </match>

      <!-- Oracle Devart driver -->
      <match assemblyName="Devart.Data.Oracle" className="Devart.Data.Oracle.OracleCommand">
        <exactMethodMatcher methodName="ExecuteReader" parameters="System.Data.CommandBehavior" />
        <exactMethodMatcher methodName="ExecuteNonQuery" />
      </match>

      <!-- MySql (official) driver-->
      <!-- Starting in 8.0.33 the non-async methods are just passthroughs to async methods which are instrumented in the SqlCommandTracerAsync factory -->
      <match assemblyName="MySql.Data" className="MySql.Data.MySqlClient.MySqlCommand" maxVersion="8.0.33">
        <exactMethodMatcher methodName="ExecuteReader" parameters="System.Data.CommandBehavior" />
        <exactMethodMatcher methodName="ExecuteNonQuery" />
      </match>

      <!-- MySql CoreLabs driver -->
      <match assemblyName="Devart.Data.MySql" className="Devart.Data.MySql.MySqlCommand">
        <exactMethodMatcher methodName="ExecuteReader" parameters="System.Data.CommandBehavior" />
        <exactMethodMatcher methodName="ExecuteNonQuery" />
      </match>

      <!-- MySqlConnector 0.x -->
      <match assemblyName="MySqlConnector" className="MySql.Data.MySqlClient.MySqlCommand">
        <exactMethodMatcher methodName="ExecuteDbDataReader" parameters="System.Data.CommandBehavior" />
        <exactMethodMatcher methodName="ExecuteReader" />
        <exactMethodMatcher methodName="ExecuteNonQuery" />
        <exactMethodMatcher methodName="ExecuteScalar" />
      </match>

      <!-- MySqlConnector 1.x -->
      <match assemblyName="MySqlConnector" className="MySqlConnector.MySqlCommand">
        <exactMethodMatcher methodName="ExecuteDbDataReader" parameters="System.Data.CommandBehavior" />
        <exactMethodMatcher methodName="ExecuteReader" />
        <exactMethodMatcher methodName="ExecuteNonQuery" />
        <exactMethodMatcher methodName="ExecuteScalar" />
      </match>

      <!-- IBM DB2 driver -->
      <match assemblyName="IBM.Data.DB2" className="IBM.Data.DB2.DB2Command">
        <exactMethodMatcher methodName="ExecuteReader" parameters="System.Data.CommandBehavior"/>
        <exactMethodMatcher methodName="ExecuteNonQuery" />
        <exactMethodMatcher methodName="ExecuteScalar" />
        <exactMethodMatcher methodName="ExecuteXmlReader"/>
      </match>

      <!-- Postgres SQL Driver-->
      <match assemblyName="Npgsql" className="Npgsql.NpgsqlCommand">
        <exactMethodMatcher methodName="ExecuteDbDataReader" parameters="System.Data.CommandBehavior"/>
        <exactMethodMatcher methodName="ExecuteNonQuery" />
        <exactMethodMatcher methodName="ExecuteScalar" />
      </match>
      <match assemblyName="Npgsql" className="Npgsql.NpgsqlCommand" minVersion="4.1">
        <exactMethodMatcher methodName="ExecuteReader" parameters="System.Data.CommandBehavior" />
      </match>
    </tracerFactory>

    <!-- NOTE: Only put async instrumentation points in this tracerFactory, non-async methods go in SqlCommandTracer (above) -->
    <tracerFactory name="SqlCommandTracerAsync">

      <!-- built in MS SQL driver (framework) -->
      <match assemblyName="System.Data" className="System.Data.SqlClient.SqlCommand">
        <exactMethodMatcher methodName="ExecuteReaderAsync" parameters="System.Data.CommandBehavior,System.Threading.CancellationToken" />
        <exactMethodMatcher methodName="ExecuteNonQueryAsync" parameters="System.Threading.CancellationToken" />
        <exactMethodMatcher methodName="ExecuteScalarAsync" parameters="System.Threading.CancellationToken" />
        <exactMethodMatcher methodName="ExecuteXmlReaderAsync" parameters="System.Threading.CancellationToken" />
      </match>

      <!-- built in MS SQL driver (core / nuget) -->
      <match assemblyName="System.Data.SqlClient" className="System.Data.SqlClient.SqlCommand">
        <exactMethodMatcher methodName="ExecuteReaderAsync" parameters="System.Data.CommandBehavior,System.Threading.CancellationToken" />
        <exactMethodMatcher methodName="ExecuteNonQueryAsync" parameters="System.Threading.CancellationToken" />
        <exactMethodMatcher methodName="ExecuteScalarAsync" parameters="System.Threading.CancellationToken" />
        <exactMethodMatcher methodName="ExecuteXmlReaderAsync" parameters="System.Threading.CancellationToken" />
      </match>

      <!-- MS SQL flagship data access driver (core & framework via nuget) -->
      <match assemblyName="Microsoft.Data.SqlClient" className="Microsoft.Data.SqlClient.SqlCommand">
        <!-- This form of ExecuteReaderAsync works for the .NET Core/Platform implementation -->
        <exactMethodMatcher methodName="ExecuteReaderAsync" parameters="System.Data.CommandBehavior,System.Threading.CancellationToken" />
        <!-- This form of (Internal)ExecuteReaderAsync works for the .NET Framework implementation -->
        <exactMethodMatcher methodName="InternalExecuteReaderAsync" parameters="System.Data.CommandBehavior,System.Threading.CancellationToken" />
        <exactMethodMatcher methodName="ExecuteNonQueryAsync" parameters="System.Threading.CancellationToken" />
        <exactMethodMatcher methodName="ExecuteScalarAsync" parameters="System.Threading.CancellationToken" />
        <exactMethodMatcher methodName="ExecuteXmlReaderAsync" parameters="System.Threading.CancellationToken" />
      </match>

      <!-- MySql (official) driver-->
      <!-- Prior to 8.0.33 we instrument non-async methods in the SqlCommandTracer factory above -->
      <match assemblyName="MySql.Data" className="MySql.Data.MySqlClient.MySqlCommand" minVersion="8.0.33">
        <exactMethodMatcher methodName="ExecuteReaderAsync" parameters="System.Data.CommandBehavior,System.Boolean,System.Threading.CancellationToken" />
        <exactMethodMatcher methodName="ExecuteNonQueryAsync" parameters="System.Boolean,System.Threading.CancellationToken" />
      </match>

      <!-- MySqlConnector 0.x -->
      <match assemblyName="MySqlConnector" className="MySql.Data.MySqlClient.MySqlCommand">
        <exactMethodMatcher methodName="ExecuteDbDataReaderAsync" parameters="System.Data.CommandBehavior,System.Threading.CancellationToken" />
        <exactMethodMatcher methodName="ExecuteReaderAsync" parameters="System.Threading.CancellationToken" />
        <exactMethodMatcher methodName="ExecuteReaderAsync" parameters="System.Data.CommandBehavior,System.Threading.CancellationToken" />
        <exactMethodMatcher methodName="ExecuteNonQueryAsync" parameters="System.Threading.CancellationToken" />
        <exactMethodMatcher methodName="ExecuteScalarAsync" parameters="System.Threading.CancellationToken" />
      </match>

      <!-- MySqlConnector 1.x -->
      <match assemblyName="MySqlConnector" className="MySqlConnector.MySqlCommand">
        <exactMethodMatcher methodName="ExecuteDbDataReaderAsync" parameters="System.Data.CommandBehavior,System.Threading.CancellationToken" />
        <exactMethodMatcher methodName="ExecuteReaderAsync" parameters="System.Threading.CancellationToken" />
        <exactMethodMatcher methodName="ExecuteReaderAsync" parameters="System.Data.CommandBehavior,System.Threading.CancellationToken" />
        <exactMethodMatcher methodName="ExecuteNonQueryAsync" parameters="System.Threading.CancellationToken" />
        <exactMethodMatcher methodName="ExecuteScalarAsync" parameters="System.Threading.CancellationToken" />
      </match>

      <!-- Postgres SQL Driver-->
      <match assemblyName="Npgsql" className="Npgsql.NpgsqlCommand">
        <exactMethodMatcher methodName="ExecuteDbDataReaderAsync"/>
        <exactMethodMatcher methodName="ExecuteNonQueryAsync"/>
        <exactMethodMatcher methodName="ExecuteScalarAsync"/>
      </match>
      <match assemblyName="Npgsql" className="Npgsql.NpgsqlCommand" minVersion="4.1">
        <exactMethodMatcher methodName="ExecuteReaderAsync"/>
      </match>

      <!-- Oracle vendor driver for ManagedDataAccess.Core packages targeting net6.0 and later (yes, they use the same assembly name for core and fw) -->
      <!-- We have to instrument every overload because they all call a "helper" method that returns a ValueTask -->
      <match assemblyName="Oracle.ManagedDataAccess" className="Oracle.ManagedDataAccess.Client.OracleCommand" minVersion="23.0.0">
        <exactMethodMatcher methodName="ExecuteReaderAsync" />
        <exactMethodMatcher methodName="ExecuteReaderAsync" parameters="System.Data.CommandBehavior" />
        <exactMethodMatcher methodName="ExecuteReaderAsync" parameters="System.Threading.CancellationToken"/>
        <exactMethodMatcher methodName="ExecuteReaderAsync" parameters="System.Data.CommandBehavior,System.Threading.CancellationToken"/>
        <exactMethodMatcher methodName="ExecuteNonQueryAsync" parameters="System.Threading.CancellationToken" />
        <exactMethodMatcher methodName="ExecuteScalarAsync" parameters="System.Threading.CancellationToken" />
        <exactMethodMatcher methodName="ExecuteXmlReaderAsync" />
        <exactMethodMatcher methodName="ExecuteXmlReaderAsync"  parameters="System.Threading.CancellationToken"/>
      </match>

      <!-- Oracle vendor driver for ManagedDataAccess packages targeting net472+ -->
      <match assemblyName="Oracle.ManagedDataAccess" className="Oracle.ManagedDataAccess.Client.OracleCommand" minVersion="4.122.23">
        <exactMethodMatcher methodName="ExecuteReaderAsync" />
        <exactMethodMatcher methodName="ExecuteReaderAsync" parameters="System.Data.CommandBehavior" />
        <exactMethodMatcher methodName="ExecuteReaderAsync" parameters="System.Threading.CancellationToken"/>
        <exactMethodMatcher methodName="ExecuteReaderAsync" parameters="System.Data.CommandBehavior,System.Threading.CancellationToken"/>
        <exactMethodMatcher methodName="ExecuteNonQueryAsync" parameters="System.Threading.CancellationToken" />
        <exactMethodMatcher methodName="ExecuteScalarAsync" parameters="System.Threading.CancellationToken" />
        <exactMethodMatcher methodName="ExecuteXmlReaderAsync" />
        <exactMethodMatcher methodName="ExecuteXmlReaderAsync"  parameters="System.Threading.CancellationToken"/>
      </match>

    </tracerFactory>

    <!-- DataReader methods. DISABLED by default due to possible performance impact. Set enabled to "true" (or omit completely) to enable this instrumentation. -->
    <!-- NOTE: this tracer factory is for non-async method instrumentation only.  For async methods, use the DataReaderTracerAsync factory below -->
    <tracerFactory name="DataReaderTracer" enabled="false">
      <!-- built in MS SQL driver (framework) -->
      <match assemblyName="System.Data" className="System.Data.SqlClient.SqlDataReader">
        <exactMethodMatcher methodName="NextResult" />
        <exactMethodMatcher methodName="Read" />
      </match>

      <!-- built in MS SQL driver (core / nuget) -->
      <match assemblyName="System.Data.SqlClient" className="System.Data.SqlClient.SqlDataReader">
        <exactMethodMatcher methodName="NextResult" />
        <exactMethodMatcher methodName="Read" />
      </match>

      <!-- MS SQL flagship data access driver -->
      <match assemblyName="Microsoft.Data.SqlClient" className="Microsoft.Data.SqlClient.SqlDataReader">
        <exactMethodMatcher methodName="NextResult" />
        <exactMethodMatcher methodName="Read" />
      </match>

      <!-- built in deprecated Oracle driver -->
      <match assemblyName="System.Data.OracleClient" className="System.Data.OracleClient.OracleDataReader">
        <exactMethodMatcher methodName="NextResult" />
        <exactMethodMatcher methodName="Read" />
      </match>

      <!-- Oracle vendor driver -->
      <match assemblyName="Oracle.DataAccess" className="Oracle.DataAccess.Client.OracleDataReader">
        <exactMethodMatcher methodName="NextResult" />
        <exactMethodMatcher methodName="Read" />
      </match>

      <!-- Oracle vendor driver for ManagedDataAccess -->
      <match assemblyName="Oracle.ManagedDataAccess" className="Oracle.ManagedDataAccess.Client.OracleDataReader">
        <exactMethodMatcher methodName="NextResult" />
        <exactMethodMatcher methodName="Read" />
      </match>

      <!-- MySql (official) driver -->
      <!-- In version 8.0.33 these methods became async and are instrumented in the DataReaderTracerAsync factory below -->
      <match assemblyName="MySql.Data" className="MySql.Data.MySqlClient.MySqlDataReader" maxVersion="8.0.33">
        <exactMethodMatcher methodName="NextResult" />
        <exactMethodMatcher methodName="Read" />
      </match>

      <!-- MySqlConnector 0.x -->
      <match assemblyName="MySqlConnector" className="MySql.Data.MySqlClient.MySqlDataReader">
        <exactMethodMatcher methodName="NextResult" />
        <exactMethodMatcher methodName="Read" />
      </match>

      <!-- MySqlConnector 1.x -->
      <match assemblyName="MySqlConnector" className="MySqlConnector.MySqlDataReader">
        <exactMethodMatcher methodName="NextResult" />
        <exactMethodMatcher methodName="Read" />
      </match>

      <!-- IBM DB2 driver -->
      <match assemblyName="IBM.Data.DB2" className="IBM.Data.DB2.DB2DataReader">
        <exactMethodMatcher methodName="NextResult" />
        <exactMethodMatcher methodName="Read" />
      </match>

      <!-- Postgres data provider -->
      <match assemblyName="Npgsql" className="Npgsql.NpgsqlDataReader" minVersion="4" maxVersion="4.1">
        <exactMethodMatcher methodName="NextResult" />
        <exactMethodMatcher methodName="Read" parameters="System.Boolean" />
      </match>
      <match assemblyName="Npgsql" className="Npgsql.NpgsqlDataReader" minVersion="4.1" maxVersion="5">
        <exactMethodMatcher methodName="Read" parameters="System.Boolean" />
        <exactMethodMatcher methodName="TryFastRead" />
      </match>
      <match assemblyName="Npgsql" className="Npgsql.NpgsqlDataReader" minVersion="5">
        <exactMethodMatcher methodName="NextResult" />
        <exactMethodMatcher methodName="Read" parameters="System.Boolean" />
        <exactMethodMatcher methodName="TryFastRead" />
      </match>
    </tracerFactory>

    <!-- NOTE: this tracer factory is for async method instrumentation only.  For non-async methods, use the DataReaderTracer factory above -->
    <tracerFactory name="DataReaderTracerAsync" enabled="false">
      <!-- built in MS SQL driver (framework) -->
      <match assemblyName="System.Data" className="System.Data.SqlClient.SqlDataReader">
        <exactMethodMatcher methodName="NextResultAsync" />
        <exactMethodMatcher methodName="ReadAsync" />
      </match>

      <!-- built in MS SQL driver (core / nuget) -->
      <match assemblyName="System.Data.SqlClient" className="System.Data.SqlClient.SqlDataReader">
        <exactMethodMatcher methodName="NextResultAsync" />
        <exactMethodMatcher methodName="ReadAsync" />
      </match>

      <match assemblyName="Microsoft.Data.SqlClient" className="Microsoft.Data.SqlClient.SqlDataReader">
        <exactMethodMatcher methodName="NextResultAsync" />
        <exactMethodMatcher methodName="ReadAsync" />
      </match>

      <!-- Prior to version 8.0.33 these methods were synchroous and are instrumented in the DataReaderTracer factory above -->
      <match assemblyName="MySql.Data" className="MySql.Data.MySqlClient.MySqlDataReader" minVersion="8.0.33">
        <exactMethodMatcher methodName="NextResultAsync" parameters="System.Boolean,System.Threading.CancellationToken" />
        <exactMethodMatcher methodName="ReadAsync" parameters="System.Boolean,System.Threading.CancellationToken" />
      </match>

      <!-- MySqlConnector 0.x -->
      <match assemblyName="MySqlConnector" className="MySql.Data.MySqlClient.MySqlDataReader">
        <exactMethodMatcher methodName="NextResultAsync" />
        <exactMethodMatcher methodName="ReadAsync" />
      </match>

      <!-- MySqlConnector 1.x -->
      <match assemblyName="MySqlConnector" className="MySqlConnector.MySqlDataReader">
        <exactMethodMatcher methodName="NextResultAsync" />
        <exactMethodMatcher methodName="ReadAsync" />
      </match>

      <!-- Postgres data provider -->
      <match assemblyName="Npgsql" className="Npgsql.NpgsqlDataReader" minVersion="4" maxVersion="4.1">
        <exactMethodMatcher methodName="NextResult" parameters="System.Boolean,System.Boolean"/>
        <exactMethodMatcher methodName="Read" parameters="System.Boolean"/>
      </match>
      <match assemblyName="Npgsql" className="Npgsql.NpgsqlDataReader" minVersion="4.1" maxVersion="5">
        <exactMethodMatcher methodName="Read" parameters="System.Boolean"/>
        <exactMethodMatcher methodName="TryFastRead" />
      </match>
      <match assemblyName="Npgsql" className="Npgsql.NpgsqlDataReader" minVersion="5">
        <exactMethodMatcher methodName="NextResult" parameters="System.Boolean,System.Threading.CancellationToken" />
        <exactMethodMatcher methodName="Read" parameters="System.Boolean,System.Threading.CancellationToken" />
        <exactMethodMatcher methodName="TryFastRead" />
      </match>
      
      <!-- Oracle vendor driver for ManagedDataAccess.Core packages targeting net6.0 and later -->
      <match assemblyName="Oracle.ManagedDataAccess" className="Oracle.ManagedDataAccess.Client.OracleDataReader" minVersion="23.0.0">
        <exactMethodMatcher methodName="ReadAsync" parameters="System.Threading.CancellationToken"/>
        <exactMethodMatcher methodName="NextResultAsync" parameters="System.Threading.CancellationToken"/>
      </match>

      <!-- Oracle vendor driver for ManagedDataAccess packages targeting net472+ -->
      <match assemblyName="Oracle.ManagedDataAccess" className="Oracle.ManagedDataAccess.Client.OracleDataReader" minVersion="4.122.23">
        <exactMethodMatcher methodName="ReadAsync" parameters="System.Threading.CancellationToken"/>
        <exactMethodMatcher methodName="NextResultAsync" parameters="System.Threading.CancellationToken"/>
      </match>
     
    </tracerFactory>


    <!-- DbConnection.Open() -->
    <tracerFactory name="OpenConnectionTracer">
      <!-- built in MS SQL driver (framework) -->
      <match assemblyName="System.Data" className="System.Data.SqlClient.SqlConnection,System.Data.Odbc.OdbcConnection,System.Data.OleDb.OleDbConnection">
        <exactMethodMatcher methodName="Open" />
      </match>

      <!-- built in MS SQL driver (core / nuget) -->
      <match assemblyName="System.Data.SqlClient" className="System.Data.SqlClient.SqlConnection">
        <exactMethodMatcher methodName="Open" />
      </match>

      <!-- MS SQL flagship data access driver -->
      <match assemblyName="Microsoft.Data.SqlClient" className="Microsoft.Data.SqlClient.SqlConnection">
        <exactMethodMatcher methodName="Open" />
      </match>

      <!-- built in deprecated Oracle driver -->
      <match assemblyName="System.Data.OracleClient" className="System.Data.OracleClient.OracleConnection">
        <exactMethodMatcher methodName="Open" />
      </match>

      <!-- Oracle vendor driver -->
      <match assemblyName="Oracle.DataAccess" className="Oracle.DataAccess.Client.OracleConnection">
        <exactMethodMatcher methodName="Open"/>
      </match>

      <!-- Oracle vendor driver for ManagedDataAccess, all versions (though some don't have OpenAsync) -->
      <match assemblyName="Oracle.ManagedDataAccess" className="Oracle.ManagedDataAccess.Client.OracleConnection">
        <exactMethodMatcher methodName="Open"/>
        <exactMethodMatcher methodName="OpenAsync" parameters="System.Threading.CancellationToken"/>
      </match>

      <!-- MySql (official) driver -->
      <match assemblyName="MySql.Data" className="MySql.Data.MySqlClient.MySqlConnection">
        <exactMethodMatcher methodName="Open"/>
      </match>
      <!-- Up until 8.0.33, OpenAsync was not actually async -->
      <match assemblyName="MySql.Data" className="MySql.Data.MySqlClient.MySqlConnection" maxVersion="8.0.33">
        <exactMethodMatcher methodName="OpenAsync"/>
      </match>
      
      <!-- MySqlConnector 0.x -->
      <match assemblyName="MySqlConnector" className="MySql.Data.MySqlClient.MySqlConnection">
        <exactMethodMatcher methodName="Open" />
      </match>

      <!-- MySqlConnector 1.x -->
      <match assemblyName="MySqlConnector" className="MySqlConnector.MySqlConnection">
        <exactMethodMatcher methodName="Open" />
      </match>

      <!-- IBM DB2 driver -->
      <match assemblyName="IBM.Data.DB2" className="IBM.Data.DB2.DB2Connection">
        <exactMethodMatcher methodName="Open"/>
      </match>

      <!-- Npgsql Postgres data provider -->
      <match assemblyName="Npgsql" className="Npgsql.NpgsqlConnection">
        <exactMethodMatcher methodName="Open" parameters="System.Boolean,System.Threading.CancellationToken"/>
      </match>
    </tracerFactory>

    <!-- DbConnection.OpenAsync() -->
    <tracerFactory name="OpenConnectionTracerAsync">
      <!-- built in MS SQL driver (framework) -->
      <match assemblyName="System.Data" className="System.Data.SqlClient.SqlConnection">
        <exactMethodMatcher methodName="OpenAsync" parameters="System.Threading.CancellationToken" />
      </match>

      <!-- built in MS SQL driver (core / nuget) -->
      <match assemblyName="System.Data.SqlClient" className="System.Data.SqlClient.SqlConnection">
        <exactMethodMatcher methodName="OpenAsync" parameters="System.Threading.CancellationToken" />
      </match>

      <!-- MS SQL flagship data access driver -->
      <match assemblyName="Microsoft.Data.SqlClient" className="Microsoft.Data.SqlClient.SqlConnection">
        <exactMethodMatcher methodName="OpenAsync" parameters="System.Threading.CancellationToken" />
      </match>

      <!-- MySql (official) driver -->
      <!-- Up until 8.0.33, OpenAsync was not actually async -->
      <match assemblyName="MySql.Data" className="MySql.Data.MySqlClient.MySqlConnection" minVersion="8.0.33">
        <exactMethodMatcher methodName="OpenAsync" parameters="System.Boolean,System.Threading.CancellationToken"/>
      </match>

      <!-- MySqlConnector 0.x -->
      <match assemblyName="MySqlConnector" className="MySql.Data.MySqlClient.MySqlConnection">
        <exactMethodMatcher methodName="OpenAsync" parameters="System.Nullable`1[MySqlConnector.Protocol.Serialization.IOBehavior],System.Threading.CancellationToken" />
      </match>

      <!-- MySqlConnector 1.x -->
      <match assemblyName="MySqlConnector" className="MySqlConnector.MySqlConnection">
        <exactMethodMatcher methodName="OpenAsync" parameters="System.Nullable`1[MySqlConnector.Protocol.Serialization.IOBehavior],System.Threading.CancellationToken" />
      </match>

      <!-- Npgsql Postgres data provider -->
      <match assemblyName="Npgsql" className="Npgsql.NpgsqlConnection">
        <exactMethodMatcher methodName="OpenAsync" parameters="System.Threading.CancellationToken"/>
      </match>
    </tracerFactory>


  </instrumentation>
</extension>
