From ab3e40790dde1d4cbc990e1871d831820430781d Mon Sep 17 00:00:00 2001 From: Timothy Mothra Date: Thu, 8 Dec 2022 12:38:28 -0800 Subject: [PATCH 1/2] remove `ImplicitUsings disable` from projects (part 6) (#3990) * remove ImplicitUsings disable from projects. ZPages * Hosting * Propagators * remove implicitusings disable from projectsn AspNetCore * Http and GrpcNetClient --- .../AspNetCoreInstrumentation.cs | 2 -- .../AspNetCoreInstrumentationOptions.cs | 1 - .../AspNetCoreMetrics.cs | 2 -- .../AspNetCoreMetricsInstrumentationOptions.cs | 1 - .../Implementation/AspNetCoreInstrumentationEventSource.cs | 1 - .../Implementation/HttpInListener.cs | 3 --- .../Implementation/HttpInMetricsListener.cs | 2 -- .../MeterProviderBuilderExtensions.cs | 1 - .../OpenTelemetry.Instrumentation.AspNetCore.csproj | 1 - .../TracerProviderBuilderExtensions.cs | 1 - .../GrpcClientInstrumentation.cs | 1 - .../GrpcClientInstrumentationOptions.cs | 2 -- .../Implementation/GrpcClientDiagnosticListener.cs | 2 -- .../Implementation/GrpcInstrumentationEventSource.cs | 1 - .../OpenTelemetry.Instrumentation.GrpcNetClient.csproj | 1 - .../TracerProviderBuilderExtensions.cs | 1 - .../HttpClientInstrumentation.cs | 1 - .../HttpClientInstrumentationOptions.cs | 3 ++- src/OpenTelemetry.Instrumentation.Http/HttpClientMetrics.cs | 1 - .../HttpRequestMessageContextPropagation.cs | 4 ++-- .../Implementation/HttpHandlerDiagnosticListener.cs | 4 ++-- .../Implementation/HttpHandlerMetricsDiagnosticListener.cs | 3 ++- .../Implementation/HttpInstrumentationEventSource.cs | 1 - .../Implementation/HttpTagHelper.cs | 3 ++- .../Implementation/HttpWebRequestActivitySource.netfx.cs | 2 -- .../OpenTelemetry.Instrumentation.Http.csproj | 1 - .../TracerProviderBuilderExtensions.cs | 1 - .../DiagnosticSourceListener.cs | 2 ++ .../DiagnosticSourceSubscriber.cs | 3 +++ .../InstrumentationEventSource.cs | 2 ++ .../DiagnosticSourceInstrumentation/PropertyFetcher.cs | 2 ++ src/OpenTelemetry/Internal/ActivityInstrumentationHelper.cs | 2 ++ 32 files changed, 21 insertions(+), 37 deletions(-) diff --git a/src/OpenTelemetry.Instrumentation.AspNetCore/AspNetCoreInstrumentation.cs b/src/OpenTelemetry.Instrumentation.AspNetCore/AspNetCoreInstrumentation.cs index cc89229ecd2..913f1408fa3 100644 --- a/src/OpenTelemetry.Instrumentation.AspNetCore/AspNetCoreInstrumentation.cs +++ b/src/OpenTelemetry.Instrumentation.AspNetCore/AspNetCoreInstrumentation.cs @@ -13,8 +13,6 @@ // See the License for the specific language governing permissions and // limitations under the License. // -using System; -using System.Collections.Generic; using OpenTelemetry.Instrumentation.AspNetCore.Implementation; namespace OpenTelemetry.Instrumentation.AspNetCore diff --git a/src/OpenTelemetry.Instrumentation.AspNetCore/AspNetCoreInstrumentationOptions.cs b/src/OpenTelemetry.Instrumentation.AspNetCore/AspNetCoreInstrumentationOptions.cs index 9c51fb5eb25..f134acb0d88 100644 --- a/src/OpenTelemetry.Instrumentation.AspNetCore/AspNetCoreInstrumentationOptions.cs +++ b/src/OpenTelemetry.Instrumentation.AspNetCore/AspNetCoreInstrumentationOptions.cs @@ -14,7 +14,6 @@ // limitations under the License. // -using System; using System.Diagnostics; using Microsoft.AspNetCore.Http; diff --git a/src/OpenTelemetry.Instrumentation.AspNetCore/AspNetCoreMetrics.cs b/src/OpenTelemetry.Instrumentation.AspNetCore/AspNetCoreMetrics.cs index eb947b9f7db..d1a91d589ac 100644 --- a/src/OpenTelemetry.Instrumentation.AspNetCore/AspNetCoreMetrics.cs +++ b/src/OpenTelemetry.Instrumentation.AspNetCore/AspNetCoreMetrics.cs @@ -14,8 +14,6 @@ // limitations under the License. // -using System; -using System.Collections.Generic; using System.Diagnostics.Metrics; using System.Reflection; using OpenTelemetry.Instrumentation.AspNetCore.Implementation; diff --git a/src/OpenTelemetry.Instrumentation.AspNetCore/AspNetCoreMetricsInstrumentationOptions.cs b/src/OpenTelemetry.Instrumentation.AspNetCore/AspNetCoreMetricsInstrumentationOptions.cs index e43b7db331b..a7819d55f32 100644 --- a/src/OpenTelemetry.Instrumentation.AspNetCore/AspNetCoreMetricsInstrumentationOptions.cs +++ b/src/OpenTelemetry.Instrumentation.AspNetCore/AspNetCoreMetricsInstrumentationOptions.cs @@ -14,7 +14,6 @@ // limitations under the License. // -using System; using System.Diagnostics; using Microsoft.AspNetCore.Http; diff --git a/src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/AspNetCoreInstrumentationEventSource.cs b/src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/AspNetCoreInstrumentationEventSource.cs index b78ab6953d0..d830208923d 100644 --- a/src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/AspNetCoreInstrumentationEventSource.cs +++ b/src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/AspNetCoreInstrumentationEventSource.cs @@ -14,7 +14,6 @@ // limitations under the License. // -using System; using System.Diagnostics.Tracing; using OpenTelemetry.Internal; diff --git a/src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/HttpInListener.cs b/src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/HttpInListener.cs index 836a24deb19..9300b651642 100644 --- a/src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/HttpInListener.cs +++ b/src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/HttpInListener.cs @@ -14,10 +14,7 @@ // limitations under the License. // -using System; -using System.Collections.Generic; using System.Diagnostics; -using System.Linq; using System.Reflection; #if !NETSTANDARD2_0 using System.Runtime.CompilerServices; diff --git a/src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/HttpInMetricsListener.cs b/src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/HttpInMetricsListener.cs index 988c4a73eca..8300a536242 100644 --- a/src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/HttpInMetricsListener.cs +++ b/src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/HttpInMetricsListener.cs @@ -14,8 +14,6 @@ // limitations under the License. // -using System; -using System.Collections.Generic; using System.Diagnostics; using System.Diagnostics.Metrics; using Microsoft.AspNetCore.Http; diff --git a/src/OpenTelemetry.Instrumentation.AspNetCore/MeterProviderBuilderExtensions.cs b/src/OpenTelemetry.Instrumentation.AspNetCore/MeterProviderBuilderExtensions.cs index 376bf86097d..c02f9975073 100644 --- a/src/OpenTelemetry.Instrumentation.AspNetCore/MeterProviderBuilderExtensions.cs +++ b/src/OpenTelemetry.Instrumentation.AspNetCore/MeterProviderBuilderExtensions.cs @@ -14,7 +14,6 @@ // limitations under the License. // -using System; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Options; using OpenTelemetry.Instrumentation.AspNetCore; diff --git a/src/OpenTelemetry.Instrumentation.AspNetCore/OpenTelemetry.Instrumentation.AspNetCore.csproj b/src/OpenTelemetry.Instrumentation.AspNetCore/OpenTelemetry.Instrumentation.AspNetCore.csproj index 2c6190af39f..81cde3fb4c2 100644 --- a/src/OpenTelemetry.Instrumentation.AspNetCore/OpenTelemetry.Instrumentation.AspNetCore.csproj +++ b/src/OpenTelemetry.Instrumentation.AspNetCore/OpenTelemetry.Instrumentation.AspNetCore.csproj @@ -8,7 +8,6 @@ disable - disable diff --git a/src/OpenTelemetry.Instrumentation.AspNetCore/TracerProviderBuilderExtensions.cs b/src/OpenTelemetry.Instrumentation.AspNetCore/TracerProviderBuilderExtensions.cs index 47b20857d78..0814cd4b0d6 100644 --- a/src/OpenTelemetry.Instrumentation.AspNetCore/TracerProviderBuilderExtensions.cs +++ b/src/OpenTelemetry.Instrumentation.AspNetCore/TracerProviderBuilderExtensions.cs @@ -14,7 +14,6 @@ // limitations under the License. // -using System; #if NET7_0_OR_GREATER using System.Diagnostics; #endif diff --git a/src/OpenTelemetry.Instrumentation.GrpcNetClient/GrpcClientInstrumentation.cs b/src/OpenTelemetry.Instrumentation.GrpcNetClient/GrpcClientInstrumentation.cs index df827346111..1e970678603 100644 --- a/src/OpenTelemetry.Instrumentation.GrpcNetClient/GrpcClientInstrumentation.cs +++ b/src/OpenTelemetry.Instrumentation.GrpcNetClient/GrpcClientInstrumentation.cs @@ -13,7 +13,6 @@ // See the License for the specific language governing permissions and // limitations under the License. // -using System; using OpenTelemetry.Instrumentation.GrpcNetClient.Implementation; namespace OpenTelemetry.Instrumentation.GrpcNetClient diff --git a/src/OpenTelemetry.Instrumentation.GrpcNetClient/GrpcClientInstrumentationOptions.cs b/src/OpenTelemetry.Instrumentation.GrpcNetClient/GrpcClientInstrumentationOptions.cs index 8a055128b03..d03c882aa6f 100644 --- a/src/OpenTelemetry.Instrumentation.GrpcNetClient/GrpcClientInstrumentationOptions.cs +++ b/src/OpenTelemetry.Instrumentation.GrpcNetClient/GrpcClientInstrumentationOptions.cs @@ -14,9 +14,7 @@ // limitations under the License. // -using System; using System.Diagnostics; -using System.Net.Http; namespace OpenTelemetry.Instrumentation.GrpcNetClient { diff --git a/src/OpenTelemetry.Instrumentation.GrpcNetClient/Implementation/GrpcClientDiagnosticListener.cs b/src/OpenTelemetry.Instrumentation.GrpcNetClient/Implementation/GrpcClientDiagnosticListener.cs index 179831d2a67..73b7cd98f6f 100644 --- a/src/OpenTelemetry.Instrumentation.GrpcNetClient/Implementation/GrpcClientDiagnosticListener.cs +++ b/src/OpenTelemetry.Instrumentation.GrpcNetClient/Implementation/GrpcClientDiagnosticListener.cs @@ -14,9 +14,7 @@ // limitations under the License. // -using System; using System.Diagnostics; -using System.Net.Http; using System.Reflection; using OpenTelemetry.Context.Propagation; using OpenTelemetry.Instrumentation.Http; diff --git a/src/OpenTelemetry.Instrumentation.GrpcNetClient/Implementation/GrpcInstrumentationEventSource.cs b/src/OpenTelemetry.Instrumentation.GrpcNetClient/Implementation/GrpcInstrumentationEventSource.cs index c171c21c59b..e16c76b8f3c 100644 --- a/src/OpenTelemetry.Instrumentation.GrpcNetClient/Implementation/GrpcInstrumentationEventSource.cs +++ b/src/OpenTelemetry.Instrumentation.GrpcNetClient/Implementation/GrpcInstrumentationEventSource.cs @@ -14,7 +14,6 @@ // limitations under the License. // -using System; using System.Diagnostics.Tracing; using OpenTelemetry.Internal; diff --git a/src/OpenTelemetry.Instrumentation.GrpcNetClient/OpenTelemetry.Instrumentation.GrpcNetClient.csproj b/src/OpenTelemetry.Instrumentation.GrpcNetClient/OpenTelemetry.Instrumentation.GrpcNetClient.csproj index 5475e389fbc..08a03911108 100644 --- a/src/OpenTelemetry.Instrumentation.GrpcNetClient/OpenTelemetry.Instrumentation.GrpcNetClient.csproj +++ b/src/OpenTelemetry.Instrumentation.GrpcNetClient/OpenTelemetry.Instrumentation.GrpcNetClient.csproj @@ -8,7 +8,6 @@ disable - disable diff --git a/src/OpenTelemetry.Instrumentation.GrpcNetClient/TracerProviderBuilderExtensions.cs b/src/OpenTelemetry.Instrumentation.GrpcNetClient/TracerProviderBuilderExtensions.cs index d53c1421910..d2223e63fe9 100644 --- a/src/OpenTelemetry.Instrumentation.GrpcNetClient/TracerProviderBuilderExtensions.cs +++ b/src/OpenTelemetry.Instrumentation.GrpcNetClient/TracerProviderBuilderExtensions.cs @@ -14,7 +14,6 @@ // limitations under the License. // -using System; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Options; using OpenTelemetry.Instrumentation.GrpcNetClient; diff --git a/src/OpenTelemetry.Instrumentation.Http/HttpClientInstrumentation.cs b/src/OpenTelemetry.Instrumentation.Http/HttpClientInstrumentation.cs index 4c7a42a0cb4..c7ffe545f21 100644 --- a/src/OpenTelemetry.Instrumentation.Http/HttpClientInstrumentation.cs +++ b/src/OpenTelemetry.Instrumentation.Http/HttpClientInstrumentation.cs @@ -13,7 +13,6 @@ // See the License for the specific language governing permissions and // limitations under the License. // -using System; using OpenTelemetry.Instrumentation.Http.Implementation; namespace OpenTelemetry.Instrumentation.Http diff --git a/src/OpenTelemetry.Instrumentation.Http/HttpClientInstrumentationOptions.cs b/src/OpenTelemetry.Instrumentation.Http/HttpClientInstrumentationOptions.cs index a4ef77bdb53..193b2141b13 100644 --- a/src/OpenTelemetry.Instrumentation.Http/HttpClientInstrumentationOptions.cs +++ b/src/OpenTelemetry.Instrumentation.Http/HttpClientInstrumentationOptions.cs @@ -14,10 +14,11 @@ // limitations under the License. // -using System; using System.Diagnostics; using System.Net; +#if NETFRAMEWORK using System.Net.Http; +#endif using System.Runtime.CompilerServices; using OpenTelemetry.Instrumentation.Http.Implementation; diff --git a/src/OpenTelemetry.Instrumentation.Http/HttpClientMetrics.cs b/src/OpenTelemetry.Instrumentation.Http/HttpClientMetrics.cs index 27b39f5da17..e48af04a625 100644 --- a/src/OpenTelemetry.Instrumentation.Http/HttpClientMetrics.cs +++ b/src/OpenTelemetry.Instrumentation.Http/HttpClientMetrics.cs @@ -14,7 +14,6 @@ // limitations under the License. // -using System; using System.Diagnostics.Metrics; using System.Reflection; using OpenTelemetry.Instrumentation.Http.Implementation; diff --git a/src/OpenTelemetry.Instrumentation.Http/HttpRequestMessageContextPropagation.cs b/src/OpenTelemetry.Instrumentation.Http/HttpRequestMessageContextPropagation.cs index 14b26850e97..3f8d3ece0e3 100644 --- a/src/OpenTelemetry.Instrumentation.Http/HttpRequestMessageContextPropagation.cs +++ b/src/OpenTelemetry.Instrumentation.Http/HttpRequestMessageContextPropagation.cs @@ -14,9 +14,9 @@ // limitations under the License. // -using System; -using System.Collections.Generic; +#if NETFRAMEWORK using System.Net.Http; +#endif namespace OpenTelemetry.Instrumentation.Http { diff --git a/src/OpenTelemetry.Instrumentation.Http/Implementation/HttpHandlerDiagnosticListener.cs b/src/OpenTelemetry.Instrumentation.Http/Implementation/HttpHandlerDiagnosticListener.cs index f2ac51c6432..a60049eb939 100644 --- a/src/OpenTelemetry.Instrumentation.Http/Implementation/HttpHandlerDiagnosticListener.cs +++ b/src/OpenTelemetry.Instrumentation.Http/Implementation/HttpHandlerDiagnosticListener.cs @@ -14,11 +14,11 @@ // limitations under the License. // -using System; using System.Diagnostics; +#if NETFRAMEWORK using System.Net.Http; +#endif using System.Reflection; -using System.Threading.Tasks; using OpenTelemetry.Context.Propagation; using OpenTelemetry.Trace; diff --git a/src/OpenTelemetry.Instrumentation.Http/Implementation/HttpHandlerMetricsDiagnosticListener.cs b/src/OpenTelemetry.Instrumentation.Http/Implementation/HttpHandlerMetricsDiagnosticListener.cs index c1924529108..79cb2c86153 100644 --- a/src/OpenTelemetry.Instrumentation.Http/Implementation/HttpHandlerMetricsDiagnosticListener.cs +++ b/src/OpenTelemetry.Instrumentation.Http/Implementation/HttpHandlerMetricsDiagnosticListener.cs @@ -14,10 +14,11 @@ // limitations under the License. // -using System.Collections.Generic; using System.Diagnostics; using System.Diagnostics.Metrics; +#if NETFRAMEWORK using System.Net.Http; +#endif using OpenTelemetry.Trace; namespace OpenTelemetry.Instrumentation.Http.Implementation diff --git a/src/OpenTelemetry.Instrumentation.Http/Implementation/HttpInstrumentationEventSource.cs b/src/OpenTelemetry.Instrumentation.Http/Implementation/HttpInstrumentationEventSource.cs index a0a5e6fa967..862348a94b1 100644 --- a/src/OpenTelemetry.Instrumentation.Http/Implementation/HttpInstrumentationEventSource.cs +++ b/src/OpenTelemetry.Instrumentation.Http/Implementation/HttpInstrumentationEventSource.cs @@ -14,7 +14,6 @@ // limitations under the License. // -using System; using System.Diagnostics.Tracing; using OpenTelemetry.Internal; diff --git a/src/OpenTelemetry.Instrumentation.Http/Implementation/HttpTagHelper.cs b/src/OpenTelemetry.Instrumentation.Http/Implementation/HttpTagHelper.cs index 6616029ef4e..83d7ea0aedc 100644 --- a/src/OpenTelemetry.Instrumentation.Http/Implementation/HttpTagHelper.cs +++ b/src/OpenTelemetry.Instrumentation.Http/Implementation/HttpTagHelper.cs @@ -13,9 +13,10 @@ // See the License for the specific language governing permissions and // limitations under the License. // -using System; using System.Collections.Concurrent; +#if NETFRAMEWORK using System.Net.Http; +#endif namespace OpenTelemetry.Instrumentation.Http.Implementation { diff --git a/src/OpenTelemetry.Instrumentation.Http/Implementation/HttpWebRequestActivitySource.netfx.cs b/src/OpenTelemetry.Instrumentation.Http/Implementation/HttpWebRequestActivitySource.netfx.cs index b011719cb6f..c1c20ac9218 100644 --- a/src/OpenTelemetry.Instrumentation.Http/Implementation/HttpWebRequestActivitySource.netfx.cs +++ b/src/OpenTelemetry.Instrumentation.Http/Implementation/HttpWebRequestActivitySource.netfx.cs @@ -15,9 +15,7 @@ // #if NETFRAMEWORK -using System; using System.Collections; -using System.Collections.Generic; using System.Diagnostics; using System.Net; using System.Reflection; diff --git a/src/OpenTelemetry.Instrumentation.Http/OpenTelemetry.Instrumentation.Http.csproj b/src/OpenTelemetry.Instrumentation.Http/OpenTelemetry.Instrumentation.Http.csproj index 724b901f9ff..ff3eece862e 100644 --- a/src/OpenTelemetry.Instrumentation.Http/OpenTelemetry.Instrumentation.Http.csproj +++ b/src/OpenTelemetry.Instrumentation.Http/OpenTelemetry.Instrumentation.Http.csproj @@ -9,7 +9,6 @@ disable - disable diff --git a/src/OpenTelemetry.Instrumentation.Http/TracerProviderBuilderExtensions.cs b/src/OpenTelemetry.Instrumentation.Http/TracerProviderBuilderExtensions.cs index c900da51f61..02415dfe160 100644 --- a/src/OpenTelemetry.Instrumentation.Http/TracerProviderBuilderExtensions.cs +++ b/src/OpenTelemetry.Instrumentation.Http/TracerProviderBuilderExtensions.cs @@ -14,7 +14,6 @@ // limitations under the License. // -using System; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Options; using OpenTelemetry.Instrumentation.Http; diff --git a/src/OpenTelemetry/DiagnosticSourceInstrumentation/DiagnosticSourceListener.cs b/src/OpenTelemetry/DiagnosticSourceInstrumentation/DiagnosticSourceListener.cs index 9e8f68c2498..d1344d6b04e 100644 --- a/src/OpenTelemetry/DiagnosticSourceInstrumentation/DiagnosticSourceListener.cs +++ b/src/OpenTelemetry/DiagnosticSourceInstrumentation/DiagnosticSourceListener.cs @@ -14,10 +14,12 @@ // limitations under the License. // +#pragma warning disable IDE0005 // Temporarily suppressing "Using directive is unnecessary" until other projects have been updated. See #3958. using System; using System.Collections.Generic; using System.Diagnostics; using OpenTelemetry.Internal; +#pragma warning restore IDE0005 namespace OpenTelemetry.Instrumentation { diff --git a/src/OpenTelemetry/DiagnosticSourceInstrumentation/DiagnosticSourceSubscriber.cs b/src/OpenTelemetry/DiagnosticSourceInstrumentation/DiagnosticSourceSubscriber.cs index a1bc100585f..4a980123a1c 100644 --- a/src/OpenTelemetry/DiagnosticSourceInstrumentation/DiagnosticSourceSubscriber.cs +++ b/src/OpenTelemetry/DiagnosticSourceInstrumentation/DiagnosticSourceSubscriber.cs @@ -13,11 +13,14 @@ // See the License for the specific language governing permissions and // limitations under the License. // + +#pragma warning disable IDE0005 // Temporarily suppressing "Using directive is unnecessary" until other projects have been updated. See #3958. using System; using System.Collections.Generic; using System.Diagnostics; using System.Threading; using OpenTelemetry.Internal; +#pragma warning restore IDE0005 namespace OpenTelemetry.Instrumentation { diff --git a/src/OpenTelemetry/DiagnosticSourceInstrumentation/InstrumentationEventSource.cs b/src/OpenTelemetry/DiagnosticSourceInstrumentation/InstrumentationEventSource.cs index 6e1760bfccd..2b7f8905e5a 100644 --- a/src/OpenTelemetry/DiagnosticSourceInstrumentation/InstrumentationEventSource.cs +++ b/src/OpenTelemetry/DiagnosticSourceInstrumentation/InstrumentationEventSource.cs @@ -14,9 +14,11 @@ // limitations under the License. // +#pragma warning disable IDE0005 // Temporarily suppressing "Using directive is unnecessary" until other projects have been updated. See #3958. using System; using System.Diagnostics.Tracing; using OpenTelemetry.Internal; +#pragma warning restore IDE0005 namespace OpenTelemetry.Instrumentation { diff --git a/src/OpenTelemetry/DiagnosticSourceInstrumentation/PropertyFetcher.cs b/src/OpenTelemetry/DiagnosticSourceInstrumentation/PropertyFetcher.cs index 6c1657fe657..834ce740dbd 100644 --- a/src/OpenTelemetry/DiagnosticSourceInstrumentation/PropertyFetcher.cs +++ b/src/OpenTelemetry/DiagnosticSourceInstrumentation/PropertyFetcher.cs @@ -14,10 +14,12 @@ // limitations under the License. // +#pragma warning disable IDE0005 // Temporarily suppressing "Using directive is unnecessary" until other projects have been updated. See #3958. using System; using System.Linq; using System.Reflection; using OpenTelemetry.Internal; +#pragma warning restore IDE0005 namespace OpenTelemetry.Instrumentation { diff --git a/src/OpenTelemetry/Internal/ActivityInstrumentationHelper.cs b/src/OpenTelemetry/Internal/ActivityInstrumentationHelper.cs index 4e527812f31..2176574e479 100644 --- a/src/OpenTelemetry/Internal/ActivityInstrumentationHelper.cs +++ b/src/OpenTelemetry/Internal/ActivityInstrumentationHelper.cs @@ -14,9 +14,11 @@ // limitations under the License. // +#pragma warning disable IDE0005 // Temporarily suppressing "Using directive is unnecessary" until other projects have been updated. See #3958. using System; using System.Diagnostics; using System.Linq.Expressions; +#pragma warning restore IDE0005 namespace OpenTelemetry.Instrumentation { From 2d02255bf802cc06ec4d5106a3dbf8c35e6ef725 Mon Sep 17 00:00:00 2001 From: Timothy Mothra Date: Thu, 8 Dec 2022 13:25:07 -0800 Subject: [PATCH 2/2] remove `ImplicitUsings disable` from projects (part 7) (#3991) * remove ImplicitUsings disable from projects. ZPages * Hosting * Propagators * remove implicitusings disable from projectsn AspNetCore * Http and GrpcNetClient * remove implicitusings disable from projects SqlClient * Shims --- .../Implementation/SqlActivitySourceHelper.cs | 2 -- .../Implementation/SqlClientDiagnosticListener.cs | 1 - .../Implementation/SqlClientInstrumentationEventSource.cs | 1 - .../Implementation/SqlEventSourceListener.netfx.cs | 1 - .../OpenTelemetry.Instrumentation.SqlClient.csproj | 1 - .../SqlClientInstrumentation.cs | 5 +---- .../SqlClientInstrumentationOptions.cs | 1 - .../TracerProviderBuilderExtensions.cs | 1 - .../OpenTelemetry.Shims.OpenTracing.csproj | 1 - src/OpenTelemetry.Shims.OpenTracing/ScopeManagerShim.cs | 4 ---- src/OpenTelemetry.Shims.OpenTracing/SpanBuilderShim.cs | 2 -- src/OpenTelemetry.Shims.OpenTracing/SpanContextShim.cs | 2 -- src/OpenTelemetry.Shims.OpenTracing/SpanShim.cs | 3 --- src/OpenTelemetry.Shims.OpenTracing/TracerShim.cs | 1 - 14 files changed, 1 insertion(+), 25 deletions(-) diff --git a/src/OpenTelemetry.Instrumentation.SqlClient/Implementation/SqlActivitySourceHelper.cs b/src/OpenTelemetry.Instrumentation.SqlClient/Implementation/SqlActivitySourceHelper.cs index fbf4fb7d83a..271a9417f7f 100644 --- a/src/OpenTelemetry.Instrumentation.SqlClient/Implementation/SqlActivitySourceHelper.cs +++ b/src/OpenTelemetry.Instrumentation.SqlClient/Implementation/SqlActivitySourceHelper.cs @@ -13,8 +13,6 @@ // See the License for the specific language governing permissions and // limitations under the License. // -using System; -using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using OpenTelemetry.Trace; diff --git a/src/OpenTelemetry.Instrumentation.SqlClient/Implementation/SqlClientDiagnosticListener.cs b/src/OpenTelemetry.Instrumentation.SqlClient/Implementation/SqlClientDiagnosticListener.cs index b383ab03896..8849f218b72 100644 --- a/src/OpenTelemetry.Instrumentation.SqlClient/Implementation/SqlClientDiagnosticListener.cs +++ b/src/OpenTelemetry.Instrumentation.SqlClient/Implementation/SqlClientDiagnosticListener.cs @@ -14,7 +14,6 @@ // limitations under the License. // #if !NETFRAMEWORK -using System; using System.Data; using System.Diagnostics; using OpenTelemetry.Trace; diff --git a/src/OpenTelemetry.Instrumentation.SqlClient/Implementation/SqlClientInstrumentationEventSource.cs b/src/OpenTelemetry.Instrumentation.SqlClient/Implementation/SqlClientInstrumentationEventSource.cs index 31a7a9737bf..4afdbac2da1 100644 --- a/src/OpenTelemetry.Instrumentation.SqlClient/Implementation/SqlClientInstrumentationEventSource.cs +++ b/src/OpenTelemetry.Instrumentation.SqlClient/Implementation/SqlClientInstrumentationEventSource.cs @@ -14,7 +14,6 @@ // limitations under the License. // -using System; using System.Diagnostics.Tracing; using OpenTelemetry.Internal; diff --git a/src/OpenTelemetry.Instrumentation.SqlClient/Implementation/SqlEventSourceListener.netfx.cs b/src/OpenTelemetry.Instrumentation.SqlClient/Implementation/SqlEventSourceListener.netfx.cs index c2065174776..a06c77c428c 100644 --- a/src/OpenTelemetry.Instrumentation.SqlClient/Implementation/SqlEventSourceListener.netfx.cs +++ b/src/OpenTelemetry.Instrumentation.SqlClient/Implementation/SqlEventSourceListener.netfx.cs @@ -15,7 +15,6 @@ // #if NETFRAMEWORK -using System; using System.Diagnostics; using System.Diagnostics.Tracing; using OpenTelemetry.Trace; diff --git a/src/OpenTelemetry.Instrumentation.SqlClient/OpenTelemetry.Instrumentation.SqlClient.csproj b/src/OpenTelemetry.Instrumentation.SqlClient/OpenTelemetry.Instrumentation.SqlClient.csproj index a986f0ebfcf..d800a38d9c9 100644 --- a/src/OpenTelemetry.Instrumentation.SqlClient/OpenTelemetry.Instrumentation.SqlClient.csproj +++ b/src/OpenTelemetry.Instrumentation.SqlClient/OpenTelemetry.Instrumentation.SqlClient.csproj @@ -9,7 +9,6 @@ disable - disable diff --git a/src/OpenTelemetry.Instrumentation.SqlClient/SqlClientInstrumentation.cs b/src/OpenTelemetry.Instrumentation.SqlClient/SqlClientInstrumentation.cs index bd6ecbe1238..380d70b20fb 100644 --- a/src/OpenTelemetry.Instrumentation.SqlClient/SqlClientInstrumentation.cs +++ b/src/OpenTelemetry.Instrumentation.SqlClient/SqlClientInstrumentation.cs @@ -13,10 +13,7 @@ // See the License for the specific language governing permissions and // limitations under the License. // -using System; -#if !NETFRAMEWORK -using System.Collections.Generic; -#endif + using OpenTelemetry.Instrumentation.SqlClient.Implementation; namespace OpenTelemetry.Instrumentation.SqlClient diff --git a/src/OpenTelemetry.Instrumentation.SqlClient/SqlClientInstrumentationOptions.cs b/src/OpenTelemetry.Instrumentation.SqlClient/SqlClientInstrumentationOptions.cs index 121fed50b81..fdb0e29eff4 100644 --- a/src/OpenTelemetry.Instrumentation.SqlClient/SqlClientInstrumentationOptions.cs +++ b/src/OpenTelemetry.Instrumentation.SqlClient/SqlClientInstrumentationOptions.cs @@ -14,7 +14,6 @@ // limitations under the License. // -using System; using System.Collections.Concurrent; using System.Data; using System.Diagnostics; diff --git a/src/OpenTelemetry.Instrumentation.SqlClient/TracerProviderBuilderExtensions.cs b/src/OpenTelemetry.Instrumentation.SqlClient/TracerProviderBuilderExtensions.cs index a12ae44c884..2279e97f5fc 100644 --- a/src/OpenTelemetry.Instrumentation.SqlClient/TracerProviderBuilderExtensions.cs +++ b/src/OpenTelemetry.Instrumentation.SqlClient/TracerProviderBuilderExtensions.cs @@ -14,7 +14,6 @@ // limitations under the License. // -using System; using OpenTelemetry.Instrumentation.SqlClient; using OpenTelemetry.Instrumentation.SqlClient.Implementation; using OpenTelemetry.Internal; diff --git a/src/OpenTelemetry.Shims.OpenTracing/OpenTelemetry.Shims.OpenTracing.csproj b/src/OpenTelemetry.Shims.OpenTracing/OpenTelemetry.Shims.OpenTracing.csproj index 5b7e1a27a48..d8070e7f7a6 100644 --- a/src/OpenTelemetry.Shims.OpenTracing/OpenTelemetry.Shims.OpenTracing.csproj +++ b/src/OpenTelemetry.Shims.OpenTracing/OpenTelemetry.Shims.OpenTracing.csproj @@ -12,7 +12,6 @@ disable - disable diff --git a/src/OpenTelemetry.Shims.OpenTracing/ScopeManagerShim.cs b/src/OpenTelemetry.Shims.OpenTracing/ScopeManagerShim.cs index 0617a16cbe7..2984d3e7e38 100644 --- a/src/OpenTelemetry.Shims.OpenTracing/ScopeManagerShim.cs +++ b/src/OpenTelemetry.Shims.OpenTracing/ScopeManagerShim.cs @@ -14,11 +14,7 @@ // limitations under the License. // -using System; using System.Runtime.CompilerServices; -#if DEBUG -using System.Threading; -#endif using OpenTelemetry.Internal; using OpenTelemetry.Trace; using OpenTracing; diff --git a/src/OpenTelemetry.Shims.OpenTracing/SpanBuilderShim.cs b/src/OpenTelemetry.Shims.OpenTracing/SpanBuilderShim.cs index 5cdbe55e85d..0c42afc6186 100644 --- a/src/OpenTelemetry.Shims.OpenTracing/SpanBuilderShim.cs +++ b/src/OpenTelemetry.Shims.OpenTracing/SpanBuilderShim.cs @@ -14,8 +14,6 @@ // limitations under the License. // -using System; -using System.Collections.Generic; using OpenTelemetry.Internal; using OpenTelemetry.Trace; using OpenTracing; diff --git a/src/OpenTelemetry.Shims.OpenTracing/SpanContextShim.cs b/src/OpenTelemetry.Shims.OpenTracing/SpanContextShim.cs index 48e7c3dc28b..4b3d979cddd 100644 --- a/src/OpenTelemetry.Shims.OpenTracing/SpanContextShim.cs +++ b/src/OpenTelemetry.Shims.OpenTracing/SpanContextShim.cs @@ -14,8 +14,6 @@ // limitations under the License. // -using System; -using System.Collections.Generic; using OpenTracing; namespace OpenTelemetry.Shims.OpenTracing diff --git a/src/OpenTelemetry.Shims.OpenTracing/SpanShim.cs b/src/OpenTelemetry.Shims.OpenTracing/SpanShim.cs index 0ce964a3302..a50d5ff0892 100644 --- a/src/OpenTelemetry.Shims.OpenTracing/SpanShim.cs +++ b/src/OpenTelemetry.Shims.OpenTracing/SpanShim.cs @@ -14,9 +14,6 @@ // limitations under the License. // -using System; -using System.Collections.Generic; -using System.Linq; using OpenTelemetry.Internal; using OpenTelemetry.Trace; using OpenTracing; diff --git a/src/OpenTelemetry.Shims.OpenTracing/TracerShim.cs b/src/OpenTelemetry.Shims.OpenTracing/TracerShim.cs index 906d78315f8..f2a3c476cc4 100644 --- a/src/OpenTelemetry.Shims.OpenTracing/TracerShim.cs +++ b/src/OpenTelemetry.Shims.OpenTracing/TracerShim.cs @@ -14,7 +14,6 @@ // limitations under the License. // -using System.Collections.Generic; using OpenTelemetry.Context.Propagation; using OpenTelemetry.Internal; using OpenTracing.Propagation;