MySql.Data - natively supported by library (#2836)

This commit is contained in:
Piotr Kiełkowicz 2023-08-14 20:09:08 +02:00 committed by GitHub
parent aa9d6a53da
commit e312446078
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
23 changed files with 41 additions and 175 deletions

View File

@ -11,10 +11,18 @@ This component adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.h
### Changed
- [MySql.Data](https://www.nuget.org/packages/MySql.Data/) instrumentation is now
supported from version 8.1.0 working on .NET.
### Deprecated
### Removed
- Removed [MySql.Data](https://www.nuget.org/packages/MySql.Data/) instrumentation
for versions 6.10.7-8.0.33.
- Removed support for `OpenTelemetry.Instrumentation.MySqlData.MySqlDataInstrumentationOptions`
for plugins.
### Fixed
### Security

View File

@ -244,7 +244,6 @@ Libraries
- OpenTelemetry.Api,
- OpenTelemetry.Instrumentation.EntityFrameworkCore,
- OpenTelemetry.Instrumentation.MySqlData,
- OpenTelemetry.Instrumentation.Process,
- OpenTelemetry.Instrumentation.Quartz,
- OpenTelemetry.Instrumentation.Runtime,

View File

@ -101,8 +101,7 @@ public static class LibraryVersion
"TestApplication.MySqlData",
new List<string>
{
"6.10.7",
"8.0.32.1",
"8.1.0",
}
},
{

View File

@ -124,38 +124,33 @@ for example `TRACES`, and `{0}` is the case-sensitive name of the instrumentatio
Traces are stable, but particular instrumentation are in Experimental status
due to lack of stable semantic convention.
| ID | Instrumented library | Supported versions | Instrumentation type | Status |
|-----------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------|-------------------------|-----------------------------------------------------------------------------------------------------------------------------------|
| `ASPNET` | ASP.NET (.NET Framework) MVC / WebApi \[1\] **Not supported on .NET** | * | source & bytecode | [Experimental](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/versioning-and-stability.md) |
| `ASPNETCORE` | ASP.NET Core **Not supported on .NET Framework** | * | source | [Experimental](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/versioning-and-stability.md) |
| `AZURE` | [Azure SDK](https://azure.github.io/azure-sdk/releases/latest/index.html) **Not supported on .NET Framework** | \[2\] | source | [Experimental](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/versioning-and-stability.md) |
| `ELASTICSEARCH` | [Elastic.Clients.Elasticsearch](https://www.nuget.org/packages/Elastic.Clients.Elasticsearch) | ≥8.0.0 | source | [Experimental](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/versioning-and-stability.md) |
| `ENTITYFRAMEWORKCORE` | [Microsoft.EntityFrameworkCore](https://www.nuget.org/packages/) **Not supported on .NET Framework** | ≥6.0.12 | source | [Experimental](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/versioning-and-stability.md) |
| `GRAPHQL` | [GraphQL](https://www.nuget.org/packages/GraphQL) **Not supported on .NET Framework** | ≥7.5.0 | source | [Experimental](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/versioning-and-stability.md) |
| `GRPCNETCLIENT` | [Grpc.Net.Client](https://www.nuget.org/packages/Grpc.Net.Client) | ≥2.52.0 & < 3.0.0 | source | [Experimental](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/versioning-and-stability.md) |
| `HTTPCLIENT` | [System.Net.Http.HttpClient](https://docs.microsoft.com/dotnet/api/system.net.http.httpclient) and [System.Net.HttpWebRequest](https://docs.microsoft.com/dotnet/api/system.net.httpwebrequest) | * | source | [Experimental](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/versioning-and-stability.md) |
| `QUARTZ` | [Quartz](https://www.nuget.org/packages/Quartz) **Not supported on .NET Framework 4.7.1 and older** | ≥3.4.0 | source | [Experimental](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/versioning-and-stability.md) |
| `MASSTRANSIT` | [MassTransit](https://www.nuget.org/packages/MassTransit) **Not supported on .NET Framework** | ≥8.0.0 | source | [Experimental](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/versioning-and-stability.md) |
| `MONGODB` | [MongoDB.Driver.Core](https://www.nuget.org/packages/MongoDB.Driver.Core) | ≥2.13.3 & < 3.0.0 | source & bytecode | [Experimental](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/versioning-and-stability.md) |
| `MYSQLCONNECTOR` | [MySqlConnector](https://www.nuget.org/packages/MySqlConnector) | ≥2.0.0 | source | [Experimental](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/versioning-and-stability.md) |
| `MYSQLDATA` | [MySql.Data](https://www.nuget.org/packages/MySql.Data) **Not supported on .NET Framework** | \[3\] | source & bytecode \[4\] | [Experimental](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/versioning-and-stability.md) |
| `NPGSQL` | [Npgsql](https://www.nuget.org/packages/Npgsql) | ≥6.0.0 | source | [Experimental](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/versioning-and-stability.md) |
| `NSERVICEBUS` | [NServiceBus](https://www.nuget.org/packages/NServiceBus) | ≥8.0.0 | source & bytecode | [Experimental](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/versioning-and-stability.md) |
| `SQLCLIENT` | [Microsoft.Data.SqlClient](https://www.nuget.org/packages/Microsoft.Data.SqlClient) and [System.Data.SqlClient](https://www.nuget.org/packages/System.Data.SqlClient) | * \[5\] | source | [Experimental](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/versioning-and-stability.md) |
| `STACKEXCHANGEREDIS` | [StackExchange.Redis](https://www.nuget.org/packages/StackExchange.Redis) **Not supported on .NET Framework** | ≥2.0.405 < 3.0.0 | source & bytecode | [Experimental](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/versioning-and-stability.md) |
| `WCFCLIENT` | [System.ServiceModel](https://www.nuget.org/packages/System.ServiceModel) **Not supported on .NET**. | ≥4.0.0.0 < 5.0.0.0 | source & bytecode | [Experimental](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/versioning-and-stability.md) |
| `WCFSERVICE` | [System.ServiceModel](https://www.nuget.org/packages/System.ServiceModel) **Not supported on .NET**. | ≥4.0.0.0 < 5.0.0.0 | source & bytecode | [Experimental](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/versioning-and-stability.md) |
| ID | Instrumented library | Supported versions | Instrumentation type | Status |
|-----------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------|----------------------|-----------------------------------------------------------------------------------------------------------------------------------|
| `ASPNET` | ASP.NET (.NET Framework) MVC / WebApi \[1\] **Not supported on .NET** | * | source & bytecode | [Experimental](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/versioning-and-stability.md) |
| `ASPNETCORE` | ASP.NET Core **Not supported on .NET Framework** | * | source | [Experimental](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/versioning-and-stability.md) |
| `AZURE` | [Azure SDK](https://azure.github.io/azure-sdk/releases/latest/index.html) **Not supported on .NET Framework** | \[2\] | source | [Experimental](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/versioning-and-stability.md) |
| `ELASTICSEARCH` | [Elastic.Clients.Elasticsearch](https://www.nuget.org/packages/Elastic.Clients.Elasticsearch) | ≥8.0.0 | source | [Experimental](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/versioning-and-stability.md) |
| `ENTITYFRAMEWORKCORE` | [Microsoft.EntityFrameworkCore](https://www.nuget.org/packages/) **Not supported on .NET Framework** | ≥6.0.12 | source | [Experimental](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/versioning-and-stability.md) |
| `GRAPHQL` | [GraphQL](https://www.nuget.org/packages/GraphQL) **Not supported on .NET Framework** | ≥7.5.0 | source | [Experimental](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/versioning-and-stability.md) |
| `GRPCNETCLIENT` | [Grpc.Net.Client](https://www.nuget.org/packages/Grpc.Net.Client) | ≥2.52.0 & < 3.0.0 | source | [Experimental](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/versioning-and-stability.md) |
| `HTTPCLIENT` | [System.Net.Http.HttpClient](https://docs.microsoft.com/dotnet/api/system.net.http.httpclient) and [System.Net.HttpWebRequest](https://docs.microsoft.com/dotnet/api/system.net.httpwebrequest) | * | source | [Experimental](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/versioning-and-stability.md) |
| `QUARTZ` | [Quartz](https://www.nuget.org/packages/Quartz) **Not supported on .NET Framework 4.7.1 and older** | ≥3.4.0 | source | [Experimental](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/versioning-and-stability.md) |
| `MASSTRANSIT` | [MassTransit](https://www.nuget.org/packages/MassTransit) **Not supported on .NET Framework** | ≥8.0.0 | source | [Experimental](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/versioning-and-stability.md) |
| `MONGODB` | [MongoDB.Driver.Core](https://www.nuget.org/packages/MongoDB.Driver.Core) | ≥2.13.3 & < 3.0.0 | source & bytecode | [Experimental](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/versioning-and-stability.md) |
| `MYSQLCONNECTOR` | [MySqlConnector](https://www.nuget.org/packages/MySqlConnector) | ≥2.0.0 | source | [Experimental](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/versioning-and-stability.md) |
| `MYSQLDATA` | [MySql.Data](https://www.nuget.org/packages/MySql.Data) **Not supported on .NET Framework** | ≥8.1.0 | source | [Experimental](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/versioning-and-stability.md) |
| `NPGSQL` | [Npgsql](https://www.nuget.org/packages/Npgsql) | ≥6.0.0 | source | [Experimental](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/versioning-and-stability.md) |
| `NSERVICEBUS` | [NServiceBus](https://www.nuget.org/packages/NServiceBus) | ≥8.0.0 | source & bytecode | [Experimental](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/versioning-and-stability.md) |
| `SQLCLIENT` | [Microsoft.Data.SqlClient](https://www.nuget.org/packages/Microsoft.Data.SqlClient) and [System.Data.SqlClient](https://www.nuget.org/packages/System.Data.SqlClient) | * \[3\] | source | [Experimental](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/versioning-and-stability.md) |
| `STACKEXCHANGEREDIS` | [StackExchange.Redis](https://www.nuget.org/packages/StackExchange.Redis) **Not supported on .NET Framework** | ≥2.0.405 < 3.0.0 | source & bytecode | [Experimental](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/versioning-and-stability.md) |
| `WCFCLIENT` | [System.ServiceModel](https://www.nuget.org/packages/System.ServiceModel) **Not supported on .NET**. | ≥4.0.0.0 < 5.0.0.0 | source & bytecode | [Experimental](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/versioning-and-stability.md) |
| `WCFSERVICE` | [System.ServiceModel](https://www.nuget.org/packages/System.ServiceModel) **Not supported on .NET**. | ≥4.0.0.0 < 5.0.0.0 | source & bytecode | [Experimental](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/versioning-and-stability.md) |
\[1\]: Only integrated pipeline mode is supported.
\[2\]: `Azure.` prefixed packages, released after October 1, 2021.
\[3\]: MySql.Data supported versions are ≥6.10.7 < 8.0.33. Support for 8.0.33 is
tracked under [#2542](https://github.com/open-telemetry/opentelemetry-dotnet-instrumentation/issues/2542).
\[4\]: MySql.Data 8.0.31 and higher requires bytecode instrumentation.
\[5\]: Microsoft.Data.SqlClient v3.* is not supported on .NET Framework, due to [issue](https://github.com/open-telemetry/opentelemetry-dotnet/issues/4243).
\[3\]: Microsoft.Data.SqlClient v3.* is not supported on .NET Framework, due to [issue](https://github.com/open-telemetry/opentelemetry-dotnet/issues/4243).
### Metrics instrumentations

View File

@ -119,7 +119,6 @@ public class MyPlugin
| OpenTelemetry.Instrumentation.Quartz.QuartzInstrumentationOptions | OpenTelemetry.Instrumentation.Quartz | 1.0.0-alpha.3 |
| OpenTelemetry.Instrumentation.SqlClient.SqlClientInstrumentationOptions | OpenTelemetry.Instrumentation.SqlClient | 1.5.1-beta.1 |
| OpenTelemetry.Instrumentation.StackExchangeRedis.StackExchangeRedisInstrumentationOptions | OpenTelemetry.Instrumentation.StackExchangeRedis | 1.0.0-rc9.10 |
| OpenTelemetry.Instrumentation.MySqlData.MySqlDataInstrumentationOptions | OpenTelemetry.Instrumentation.MySqlData | 1.0.0-beta.7 |
| OpenTelemetry.Instrumentation.Wcf.WcfInstrumentationOptions | OpenTelemetry.Instrumentation.Wcf | 1.0.0-rc.10 |
### Metrics

View File

@ -7,17 +7,15 @@
<PackageReference Include="Pipelines.Sockets.Unofficial" ExcludeAssets="all" />
<!-- System.Diagnostics.PerformanceCounter is tranistive dependency required by OpenTelemetry.Instrumentation.StackExchangeRedis. -->
<PackageReference Include="System.Diagnostics.PerformanceCounter" ExcludeAssets="all" />
<!-- MySql.Data is required by OpenTelemetry.Instrumentation.MySqlData. -->
<PackageReference Include="MySql.Data" ExcludeAssets="all" />
<!-- System.Configuration.ConfigurationManager is tranistive dependency required by OpenTelemetry.Instrumentation.MySqlData. -->
<!-- System.Configuration.ConfigurationManager is tranistive dependency required by OpenTelemetry.Instrumentation.StackExchangeRedis. -->
<PackageReference Include="System.Configuration.ConfigurationManager" ExcludeAssets="all" />
<!-- System.Security.Cryptography.ProtectedData is tranistive dependency required by OpenTelemetry.Instrumentation.MySqlData. -->
<!-- System.Security.Cryptography.ProtectedData is tranistive dependency required by OpenTelemetry.Instrumentation.StackExchangeRedis. -->
<PackageReference Include="System.Security.Cryptography.ProtectedData" ExcludeAssets="all" />
<!-- System.Drawing.Common is tranistive dependency required by OpenTelemetry.Instrumentation.MySqlData. -->
<!-- System.Drawing.Common is tranistive dependency required by OpenTelemetry.Instrumentation.StackExchangeRedis. -->
<PackageReference Include="System.Drawing.Common" ExcludeAssets="all" />
<!-- System.Windows.Extensions is tranistive dependency required by OpenTelemetry.Instrumentation.MySqlData. -->
<!-- System.Windows.Extensions is tranistive dependency required by OpenTelemetry.Instrumentation.StackExchangeRedis. -->
<PackageReference Include="System.Windows.Extensions" ExcludeAssets="all" />
<!-- Microsoft.Win32.SystemEvents is tranistive dependency required by OpenTelemetry.Instrumentation.MySqlData. -->
<!-- Microsoft.Win32.SystemEvents is tranistive dependency required by OpenTelemetry.Instrumentation.StackExchangeRedis. -->
<PackageReference Include="Microsoft.Win32.SystemEvents" ExcludeAssets="all" />
<!-- Microsoft.Bcl.AsyncInterfaces is required by StackExchange.Redis. -->
<PackageReference Include="Microsoft.Bcl.AsyncInterfaces" ExcludeAssets="all" />

View File

@ -23,7 +23,6 @@
<PackageVersion Include="OpenTelemetry.Instrumentation.AspNetCore" Version="1.5.1-beta.1" />
<PackageVersion Include="OpenTelemetry.Instrumentation.EntityFrameworkCore" Version="1.0.0-beta.7" />
<PackageVersion Include="OpenTelemetry.Instrumentation.GrpcNetClient" Version="1.5.1-beta.1" />
<PackageVersion Include="OpenTelemetry.Instrumentation.MySqlData" Version="1.0.0-beta.7" />
<PackageVersion Include="OpenTelemetry.Instrumentation.Process" Version="0.5.0-beta.3" />
<PackageVersion Include="OpenTelemetry.Instrumentation.Quartz" Version="1.0.0-alpha.3" />
<PackageVersion Include="OpenTelemetry.Instrumentation.Runtime" Version="1.5.0" />
@ -47,7 +46,6 @@
<PackageVersion Include="MongoDB.Bson" Version="2.13.3" />
<PackageVersion Include="MongoDB.Driver.Core" Version="2.13.3" />
<PackageVersion Include="MongoDB.Libmongocrypt" Version="1.2.2" />
<PackageVersion Include="MySql.Data" Version="6.10.7" />
<PackageVersion Include="Pipelines.Sockets.Unofficial" Version="2.1.16" />
<PackageVersion Include="SharpCompress" Version="0.23.0" />
<PackageVersion Include="StackExchange.Redis" Version="2.1.58" />

View File

@ -18,7 +18,6 @@ OpenTelemetry.AutoInstrumentation.DuckTyping.IDuckType.ToString() -> string!
OpenTelemetry.AutoInstrumentation.DuckTyping.IDuckType.Type.get -> System.Type!
OpenTelemetry.AutoInstrumentation.Instrumentations.Logger.LoggingBuilderIntegration
OpenTelemetry.AutoInstrumentation.Instrumentations.MongoDB.MongoClientIntegration
OpenTelemetry.AutoInstrumentation.Instrumentations.MySqlData.MySqlConnectionStringBuilderIntegration
OpenTelemetry.AutoInstrumentation.Instrumentations.NServiceBus.EndpointConfigurationIntegration
OpenTelemetry.AutoInstrumentation.Instrumentations.StackExchangeRedis.StackExchangeRedisIntegration
OpenTelemetry.AutoInstrumentation.Instrumentations.StackExchangeRedis.StackExchangeRedisIntegrationAsync

View File

@ -60,11 +60,6 @@ internal static class DelayedInitialization
}
#if NET6_0_OR_GREATER
[MethodImpl(MethodImplOptions.NoInlining)]
public static void AddMySqlClient(LazyInstrumentationLoader lazyInstrumentationLoader, PluginManager pluginManager)
{
lazyInstrumentationLoader.Add(new MySqlDataInitializer(pluginManager));
}
[MethodImpl(MethodImplOptions.NoInlining)]
public static void AddEntityFrameworkCore(LazyInstrumentationLoader lazyInstrumentationLoader, PluginManager pluginManager)

View File

@ -49,7 +49,7 @@ internal static class EnvironmentConfigurationTracerHelper
#if NET6_0_OR_GREATER
TracerInstrumentation.AspNetCore => Wrappers.AddAspNetCoreInstrumentation(builder, pluginManager, lazyInstrumentationLoader),
TracerInstrumentation.MassTransit => builder.AddSource("MassTransit"),
TracerInstrumentation.MySqlData => Wrappers.AddMySqlClientInstrumentation(builder, pluginManager, lazyInstrumentationLoader),
TracerInstrumentation.MySqlData => builder.AddSource("connector-net"),
TracerInstrumentation.StackExchangeRedis => builder.AddSource("OpenTelemetry.Instrumentation.StackExchangeRedis"),
TracerInstrumentation.EntityFrameworkCore => Wrappers.AddEntityFrameworkCoreInstrumentation(builder, pluginManager, lazyInstrumentationLoader),
TracerInstrumentation.GraphQL => Wrappers.AddGraphQLInstrumentation(builder, pluginManager, lazyInstrumentationLoader, settings),
@ -160,14 +160,6 @@ internal static class EnvironmentConfigurationTracerHelper
.AddLegacySource("Microsoft.AspNetCore.Hosting.HttpRequestIn");
}
[MethodImpl(MethodImplOptions.NoInlining)]
public static TracerProviderBuilder AddMySqlClientInstrumentation(TracerProviderBuilder builder, PluginManager pluginManager, LazyInstrumentationLoader lazyInstrumentationLoader)
{
DelayedInitialization.Traces.AddMySqlClient(lazyInstrumentationLoader, pluginManager);
return builder.AddSource("OpenTelemetry.Instrumentation.MySqlData");
}
public static TracerProviderBuilder AddGraphQLInstrumentation(TracerProviderBuilder builder, PluginManager pluginManager, LazyInstrumentationLoader lazyInstrumentationLoader, TracerSettings tracerSettings)
{
DelayedInitialization.Traces.AddGraphQL(lazyInstrumentationLoader, pluginManager, tracerSettings);

View File

@ -19,7 +19,7 @@ internal static partial class InstrumentationDefinitions
private static NativeCallTargetDefinition[] GetDefinitionsArray()
{
var nativeCallTargetDefinitions = new List<NativeCallTargetDefinition>(12);
var nativeCallTargetDefinitions = new List<NativeCallTargetDefinition>(11);
// Traces
var tracerSettings = Instrumentation.TracerSettings.Value;
if (tracerSettings.TracesEnabled)
@ -30,12 +30,6 @@ internal static partial class InstrumentationDefinitions
nativeCallTargetDefinitions.Add(new("MongoDB.Driver", "MongoDB.Driver.MongoClient", ".ctor", new[] {"System.Void", "MongoDB.Driver.MongoClientSettings"}, 2, 13, 3, 2, 65535, 65535, AssemblyFullName, "OpenTelemetry.AutoInstrumentation.Instrumentations.MongoDB.MongoClientIntegration"));
}
// MySqlData
if (tracerSettings.EnabledInstrumentations.Contains(TracerInstrumentation.MySqlData))
{
nativeCallTargetDefinitions.Add(new("MySql.Data", "MySql.Data.MySqlClient.MySqlConnectionStringBuilder", "get_Logging", new[] {"System.Boolean"}, 8, 0, 31, 8, 65535, 65535, AssemblyFullName, "OpenTelemetry.AutoInstrumentation.Instrumentations.MySqlData.MySqlConnectionStringBuilderIntegration"));
}
// NServiceBus
if (tracerSettings.EnabledInstrumentations.Contains(TracerInstrumentation.NServiceBus))
{

View File

@ -291,7 +291,6 @@ internal static class Instrumentation
DelayedInitialization.Traces.AddAspNetCore(lazyInstrumentationLoader, pluginManager);
break;
case TracerInstrumentation.MySqlData:
DelayedInitialization.Traces.AddMySqlClient(LazyInstrumentationLoader, pluginManager);
break;
case TracerInstrumentation.EntityFrameworkCore:
DelayedInitialization.Traces.AddEntityFrameworkCore(LazyInstrumentationLoader, pluginManager);

View File

@ -1,57 +0,0 @@
// <copyright file="MySqlConnectionStringBuilderIntegration.cs" company="OpenTelemetry Authors">
// Copyright The OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// </copyright>
#if NET6_0_OR_GREATER
using OpenTelemetry.AutoInstrumentation.CallTarget;
namespace OpenTelemetry.AutoInstrumentation.Instrumentations.MySqlData;
/// <summary>
/// MySql.Data.MySqlClient.MySqlConnectionStringBuilder calltarget instrumentation
/// </summary>
[InstrumentMethod(
assemblyName: "MySql.Data",
typeName: "MySql.Data.MySqlClient.MySqlConnectionStringBuilder",
methodName: "get_Logging",
returnTypeName: ClrNames.Bool,
parameterTypeNames: new string[0],
minimumVersion: "8.0.31",
maximumVersion: "8.65535.65535",
integrationName: "MySqlData",
type: InstrumentationType.Trace)]
public static class MySqlConnectionStringBuilderIntegration
{
private static readonly object TrueAsObject = true;
/// <summary>
/// OnMethodEnd callback
/// </summary>
/// <param name="returnValue">Return value</param>
/// <param name="exception">Exception value</param>
/// <param name="state">CallTarget state</param>
/// <typeparam name="TTarget">Type of the target</typeparam>
/// <typeparam name="TReturn">Return type</typeparam>
/// <returns>A response value, in an async scenario will be T of Task of T</returns>
internal static CallTargetReturn<TReturn> OnMethodEnd<TTarget, TReturn>(TReturn returnValue, Exception exception, in CallTargetState state)
where TTarget : struct
{
var alwaysReturnTrue = (TReturn)TrueAsObject;
return new CallTargetReturn<TReturn>(alwaysReturnTrue);
}
}
#endif

View File

@ -1,45 +0,0 @@
// <copyright file="MySqlDataInitializer.cs" company="OpenTelemetry Authors">
// Copyright The OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// </copyright>
#if NET6_0_OR_GREATER
using OpenTelemetry.AutoInstrumentation.Plugins;
namespace OpenTelemetry.AutoInstrumentation.Loading.Initializers;
internal class MySqlDataInitializer : InstrumentationInitializer
{
private readonly PluginManager _pluginManager;
public MySqlDataInitializer(PluginManager pluginManager)
: base("MySql.Data")
{
_pluginManager = pluginManager;
}
public override void Initialize(ILifespanManager lifespanManager)
{
var instrumentationType = Type.GetType("OpenTelemetry.Instrumentation.MySqlData.MySqlDataInstrumentation, OpenTelemetry.Instrumentation.MySqlData")!;
var options = new OpenTelemetry.Instrumentation.MySqlData.MySqlDataInstrumentationOptions();
_pluginManager.ConfigureTracesOptions(options);
var instrumentation = Activator.CreateInstance(instrumentationType, options)!;
lifespanManager.Track(instrumentation);
}
}
#endif

View File

@ -56,7 +56,6 @@
<PackageReference Include="OpenTelemetry.Exporter.OpenTelemetryProtocol.Logs" />
<PackageReference Include="OpenTelemetry.Instrumentation.AspNetCore" />
<PackageReference Include="OpenTelemetry.Instrumentation.EntityFrameworkCore" />
<PackageReference Include="OpenTelemetry.Instrumentation.MySqlData" />
</ItemGroup>
<ItemGroup Label="Transient dependencies auto-generated by GenerateNetFxTransientDependencies" Condition=" '$(TargetFramework)' == 'net462' AND $(_IsPacking) != true ">

View File

@ -29,7 +29,7 @@
<PackageVersion Include="MongoDB.Driver" Version="2.21.0" />
<PackageVersion Include="NSubstitute" Version="5.0.0" />
<PackageVersion Include="MySqlConnector" Version="2.2.7" />
<PackageVersion Include="MySql.Data" Version="8.0.32.1" />
<PackageVersion Include="MySql.Data" Version="8.1.0" />
<PackageVersion Include="NServiceBus" Version="8.1.1" />
<PackageVersion Include="Newtonsoft.Json" Version="13.0.3" />
<PackageVersion Include="Npgsql" Version="7.0.4" />

View File

@ -29,7 +29,6 @@
/net/OpenTelemetry.Instrumentation.EntityFrameworkCore.dll,
/net/OpenTelemetry.Instrumentation.GrpcNetClient.dll,
/net/OpenTelemetry.Instrumentation.Http.dll,
/net/OpenTelemetry.Instrumentation.MySqlData.dll,
/net/OpenTelemetry.Instrumentation.Process.dll,
/net/OpenTelemetry.Instrumentation.Quartz.dll,
/net/OpenTelemetry.Instrumentation.Runtime.dll,

View File

@ -29,7 +29,6 @@
/net/OpenTelemetry.Instrumentation.EntityFrameworkCore.dll,
/net/OpenTelemetry.Instrumentation.GrpcNetClient.dll,
/net/OpenTelemetry.Instrumentation.Http.dll,
/net/OpenTelemetry.Instrumentation.MySqlData.dll,
/net/OpenTelemetry.Instrumentation.Process.dll,
/net/OpenTelemetry.Instrumentation.Quartz.dll,
/net/OpenTelemetry.Instrumentation.Runtime.dll,

View File

@ -28,7 +28,6 @@
/net/OpenTelemetry.Instrumentation.EntityFrameworkCore.dll,
/net/OpenTelemetry.Instrumentation.GrpcNetClient.dll,
/net/OpenTelemetry.Instrumentation.Http.dll,
/net/OpenTelemetry.Instrumentation.MySqlData.dll,
/net/OpenTelemetry.Instrumentation.Process.dll,
/net/OpenTelemetry.Instrumentation.Quartz.dll,
/net/OpenTelemetry.Instrumentation.Runtime.dll,

View File

@ -28,7 +28,6 @@
\net\OpenTelemetry.Instrumentation.EntityFrameworkCore.dll,
\net\OpenTelemetry.Instrumentation.GrpcNetClient.dll,
\net\OpenTelemetry.Instrumentation.Http.dll,
\net\OpenTelemetry.Instrumentation.MySqlData.dll,
\net\OpenTelemetry.Instrumentation.Process.dll,
\net\OpenTelemetry.Instrumentation.Quartz.dll,
\net\OpenTelemetry.Instrumentation.Runtime.dll,

View File

@ -112,8 +112,7 @@ public static class LibraryVersion
#if DEFAULT_TEST_PACKAGE_VERSIONS
new object[] { string.Empty }
#else
new object[] { "6.10.7" },
new object[] { "8.0.32.1" },
new object[] { "8.1.0" },
#endif
};
public static readonly IReadOnlyCollection<object[]> Npgsql = new List<object[]>

View File

@ -39,7 +39,7 @@ public class MySqlDataTests : TestHelper
{
using var collector = new MockSpansCollector(Output);
SetExporter(collector);
collector.Expect("OpenTelemetry.Instrumentation.MySqlData");
collector.Expect("connector-net");
EnableBytecodeInstrumentation();
RunTestApplication(new()

View File

@ -141,7 +141,6 @@ internal static class PackageVersionDefinitions
TestApplicationName = "TestApplication.MySqlData",
Versions = new List<string>
{
"6.10.7",
"*"
}
},