MySql.Data.OpenTelemetry
8.3.0
Prefix Reserved
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
<PackageReference Include="MySql.Data.OpenTelemetry" Version="8.3.0" />
<PackageVersion Include="MySql.Data.OpenTelemetry" Version="8.3.0" />
<PackageReference Include="MySql.Data.OpenTelemetry" />
paket add MySql.Data.OpenTelemetry --version 8.3.0
#r "nuget: MySql.Data.OpenTelemetry, 8.3.0"
#:package MySql.Data.OpenTelemetry@8.3.0
#addin nuget:?package=MySql.Data.OpenTelemetry&version=8.3.0
#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);
}
Related Packages
- Core package: MySql.Data
- Entity Framework Core: MySql.EntityFrameworkCore
- Entity Framework: MySql.Data.EntityFramework
- Web: MySql.Web
Contributing
There are a few ways to contribute to the Connector/NET code. Please refer to the contributing guidelines for additional information.
Additional Resources
- MySQL
- MySQL Connector/NET GitHub
- MySQL Connector/NET API
- MySQL Connector/NET Discussion Forum
- MySQL Public Bug Tracker
#connectorschannel in MySQL Community Slack (Sign-up required when not using an Oracle account)- For more information about this and other MySQL products, please visit MySQL Contact & Questions.
| Product | Versions 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. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.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. |
-
.NETStandard 2.0
- No dependencies.
NuGet packages (3)
Showing the top 3 NuGet packages that depend on MySql.Data.OpenTelemetry:
| Package | Downloads |
|---|---|
|
Penguin.CleanArchitecture.Common
Common Libraries for Clean Architecture |
|
|
APF.Core.OpenTelemetry
This client library enables OpenTelemetry implementation in the APF services. |
|
|
ISC.OpenTelemetryExtension
Thư viện OpenTelemetry tùy chỉnh cho .NET |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 9.7.0 | 36,131 | 4/22/2026 |
| 9.6.0 | 61,035 | 1/21/2026 |
| 9.5.0 | 60,603 | 10/22/2025 |
| 9.4.0 | 150,300 | 7/22/2025 |
| 9.3.0 | 100,080 | 4/15/2025 |
| 9.2.0 | 93,761 | 1/21/2025 |
| 9.1.0 | 183,342 | 10/15/2024 |
| 9.0.0 | 108,302 | 7/1/2024 |
| 8.4.0 | 135,611 | 4/30/2024 |
| 8.3.0 | 1,571,321 | 1/16/2024 |
| 8.2.0 | 533,079 | 10/25/2023 |
| 8.1.0 | 286,283 | 7/18/2023 |