MySql.Data.OpenTelemetry
9.1.0
Prefix Reserved
dotnet add package MySql.Data.OpenTelemetry --version 9.1.0
NuGet\Install-Package MySql.Data.OpenTelemetry -Version 9.1.0
<PackageReference Include="MySql.Data.OpenTelemetry" Version="9.1.0" />
paket add MySql.Data.OpenTelemetry --version 9.1.0
#r "nuget: MySql.Data.OpenTelemetry, 9.1.0"
// Install MySql.Data.OpenTelemetry as a Cake Addin #addin nuget:?package=MySql.Data.OpenTelemetry&version=9.1.0 // Install MySql.Data.OpenTelemetry as a Cake Tool #tool nuget:?package=MySql.Data.OpenTelemetry&version=9.1.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 enables telemetry capabilities. 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
Licensing
Please refer to files README and LICENSE, available in the Connector/NET GitHub repository, and Legal Notices in documentation for further details.
Security
Oracle values the independent security research community and believes that responsible disclosure of security vulnerabilities helps us ensure the security and privacy of all our users. Please refer to the security guidelines document for additional information.
Contributing
We greatly appreciate feedback from our users, including bug reports and code contributions. Your input helps us improve, and we thank you for any issues you report or code you contribute. Please refer to the contributing guidelines document for additional information.
Additional Resources
- MySQL Connector/NET GitHub
- MySQL Connector/NET Developer Guide
- MySQL Connector/NET API
- MySQL NuGet
- MySQL Connector/NET and C#, Mono, .Net Forum
#connectors
channel on MySQL Community Slack (Sign-up required if you do not have an Oracle account.)- @MySQL on X.
- MySQL Blog.
- MySQL Connectors Blog archive.
- MySQL Newsletter.
- MySQL Bugs Tracking System.
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. |
.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
- OpenTelemetry.Api (>= 1.9.0)
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.