MySql.Data.OpenTelemetry 8.3.0

Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
dotnet add package MySql.Data.OpenTelemetry --version 8.3.0                
NuGet\Install-Package MySql.Data.OpenTelemetry -Version 8.3.0                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="MySql.Data.OpenTelemetry" Version="8.3.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add MySql.Data.OpenTelemetry --version 8.3.0                
#r "nuget: MySql.Data.OpenTelemetry, 8.3.0"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install MySql.Data.OpenTelemetry as a Cake Addin
#addin nuget:?package=MySql.Data.OpenTelemetry&version=8.3.0

// Install MySql.Data.OpenTelemetry as a Cake Tool
#tool nuget:?package=MySql.Data.OpenTelemetry&version=8.3.0                

About

MySQL provides connectivity for client applications developed in .NET compatible programming languages with MySQL Connector/NET through a series of packages.

MySql.Data.OpenTelemetry activates telemetry capabilities when the target MySQL server is configured to support telemetry. It is compatible with .NET 6.0+ and must be used alongside the MySql.Data package. An OpenTelemetry SDK is required.

More information at [MySQL Connector/NET documentation] (https://dev.mysql.com/doc/connector-net/en/).

How to use

    //create the tracer provider and add Connector/NET as a source from telemetry data.
    using var tracerProvider = Sdk.CreateTracerProviderBuilder()
            .AddConnectorNet()
            .ConfigureResource(resource => resource.AddService("connector-net"))
            .Build();

    //use MySql.Data as usual, the internal implementation of OpenTelemetry is now enabled.
    MySql.Data.MySqlClient.MySqlConnection myConnection;
    string myConnectionString;
    //set the correct values for your server, user, password and database name
    myConnectionString = "server=127.0.0.1;uid=root;pwd=12345;database=test";

    try
    {
      myConnection = new MySql.Data.MySqlClient.MySqlConnection(myConnectionString);
      //open a connection
      myConnection.Open();

      // create a MySQL command and set the SQL statement with parameters
      MySqlCommand myCommand = new MySqlCommand();
      myCommand.Connection = myConnection;
      myCommand.CommandText = @"SELECT * FROM clients WHERE client_id = @clientId;";
      myCommand.Parameters.AddWithValue("@clientId", clientId);

      // execute the command and read the results
      using var myReader = myCommand.ExecuteReader()
      {
        while (myReader.Read())
        {
          var id = myReader.GetInt32("client_id");
          var name = myReader.GetString("client_name");
          // ...
        }
      }
      myConnection.Close();
    }
    catch (MySql.Data.MySqlClient.MySqlException ex)
    {
      MessageBox.Show(ex.Message);
    }

Contributing

There are a few ways to contribute to the Connector/NET code. Please refer to the contributing guidelines for additional information.

Additional Resources

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETStandard 2.0

    • No dependencies.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on MySql.Data.OpenTelemetry:

Package Downloads
Grafana.OpenTelemetry.Base

Minimal Grafana distribution of OpenTelemetry .NET

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
9.1.0 10,219 10/15/2024
9.0.0 59,117 7/1/2024
8.4.0 26,143 4/30/2024
8.3.0 397,482 1/16/2024
8.2.0 176,015 10/25/2023
8.1.0 41,944 7/18/2023