diff --git a/src/OpenTelemetry.Api/Baggage.cs b/src/OpenTelemetry.Api/Baggage.cs index 087dead3342..3dddf60ef89 100644 --- a/src/OpenTelemetry.Api/Baggage.cs +++ b/src/OpenTelemetry.Api/Baggage.cs @@ -377,7 +377,7 @@ private static BaggageHolder EnsureBaggageHolder() return baggageHolder; } - private class BaggageHolder + private sealed class BaggageHolder { public Baggage Baggage; } diff --git a/src/OpenTelemetry.Api/Internal/OpenTelemetryApiEventSource.cs b/src/OpenTelemetry.Api/Internal/OpenTelemetryApiEventSource.cs index 0c802e3c2c0..55f1bd54c09 100644 --- a/src/OpenTelemetry.Api/Internal/OpenTelemetryApiEventSource.cs +++ b/src/OpenTelemetry.Api/Internal/OpenTelemetryApiEventSource.cs @@ -24,7 +24,7 @@ namespace OpenTelemetry.Internal /// This is used for internal logging of this library. /// [EventSource(Name = "OpenTelemetry-Api")] - internal class OpenTelemetryApiEventSource : EventSource + internal sealed class OpenTelemetryApiEventSource : EventSource { public static OpenTelemetryApiEventSource Log = new(); diff --git a/src/OpenTelemetry.Exporter.Jaeger/ApacheThrift/Protocol/TProtocolException.cs b/src/OpenTelemetry.Exporter.Jaeger/ApacheThrift/Protocol/TProtocolException.cs index f2f47895190..8e6d3a8121f 100644 --- a/src/OpenTelemetry.Exporter.Jaeger/ApacheThrift/Protocol/TProtocolException.cs +++ b/src/OpenTelemetry.Exporter.Jaeger/ApacheThrift/Protocol/TProtocolException.cs @@ -1,4 +1,4 @@ -// (Turns off StyleCop analysis in this file.) +// (Turns off StyleCop analysis in this file.) // Licensed to the Apache Software Foundation(ASF) under one // or more contributor license agreements.See the NOTICE file diff --git a/src/OpenTelemetry.Exporter.Jaeger/ApacheThrift/TException.cs b/src/OpenTelemetry.Exporter.Jaeger/ApacheThrift/TException.cs index a7040f0153e..14d46fe6ad4 100644 --- a/src/OpenTelemetry.Exporter.Jaeger/ApacheThrift/TException.cs +++ b/src/OpenTelemetry.Exporter.Jaeger/ApacheThrift/TException.cs @@ -1,4 +1,4 @@ -// (Turns off StyleCop analysis in this file.) +// (Turns off StyleCop analysis in this file.) // Licensed to the Apache Software Foundation(ASF) under one // or more contributor license agreements.See the NOTICE file diff --git a/src/OpenTelemetry.Exporter.Jaeger/Implementation/JaegerExporterEventSource.cs b/src/OpenTelemetry.Exporter.Jaeger/Implementation/JaegerExporterEventSource.cs index c22dd408b65..f3fee3b9da3 100644 --- a/src/OpenTelemetry.Exporter.Jaeger/Implementation/JaegerExporterEventSource.cs +++ b/src/OpenTelemetry.Exporter.Jaeger/Implementation/JaegerExporterEventSource.cs @@ -24,7 +24,7 @@ namespace OpenTelemetry.Exporter.Jaeger.Implementation /// EventSource events emitted from the project. /// [EventSource(Name = "OpenTelemetry-Exporter-Jaeger")] - internal class JaegerExporterEventSource : EventSource + internal sealed class JaegerExporterEventSource : EventSource { public static JaegerExporterEventSource Log = new(); diff --git a/src/OpenTelemetry.Exporter.OpenTelemetryProtocol/Implementation/OpenTelemetryProtocolExporterEventSource.cs b/src/OpenTelemetry.Exporter.OpenTelemetryProtocol/Implementation/OpenTelemetryProtocolExporterEventSource.cs index 17db6324a1b..80351d19f28 100644 --- a/src/OpenTelemetry.Exporter.OpenTelemetryProtocol/Implementation/OpenTelemetryProtocolExporterEventSource.cs +++ b/src/OpenTelemetry.Exporter.OpenTelemetryProtocol/Implementation/OpenTelemetryProtocolExporterEventSource.cs @@ -21,7 +21,7 @@ namespace OpenTelemetry.Exporter.OpenTelemetryProtocol.Implementation { [EventSource(Name = "OpenTelemetry-Exporter-OpenTelemetryProtocol")] - internal class OpenTelemetryProtocolExporterEventSource : EventSource + internal sealed class OpenTelemetryProtocolExporterEventSource : EventSource { public static readonly OpenTelemetryProtocolExporterEventSource Log = new(); diff --git a/src/OpenTelemetry.Exporter.OpenTelemetryProtocol/OtlpLogExporter.cs b/src/OpenTelemetry.Exporter.OpenTelemetryProtocol/OtlpLogExporter.cs index 8bcde202e7f..9ca0e4570f0 100644 --- a/src/OpenTelemetry.Exporter.OpenTelemetryProtocol/OtlpLogExporter.cs +++ b/src/OpenTelemetry.Exporter.OpenTelemetryProtocol/OtlpLogExporter.cs @@ -28,7 +28,7 @@ namespace OpenTelemetry.Exporter /// Exporter consuming and exporting the data using /// the OpenTelemetry protocol (OTLP). /// - internal class OtlpLogExporter : BaseExporter + internal sealed class OtlpLogExporter : BaseExporter { private readonly SdkLimitOptions sdkLimitOptions; private readonly IExportClient exportClient; diff --git a/src/OpenTelemetry.Exporter.ZPages/Implementation/ZPagesActivityAggregate.cs b/src/OpenTelemetry.Exporter.ZPages/Implementation/ZPagesActivityAggregate.cs index 842210b2473..2887989bbc0 100644 --- a/src/OpenTelemetry.Exporter.ZPages/Implementation/ZPagesActivityAggregate.cs +++ b/src/OpenTelemetry.Exporter.ZPages/Implementation/ZPagesActivityAggregate.cs @@ -22,7 +22,7 @@ namespace OpenTelemetry.Exporter.ZPages.Implementation /// /// Stores the activity information aggregated according to activity name. /// - internal class ZPagesActivityAggregate + internal sealed class ZPagesActivityAggregate { /// /// Initializes a new instance of the class. diff --git a/src/OpenTelemetry.Exporter.ZPages/Implementation/ZPagesExporterEventSource.cs b/src/OpenTelemetry.Exporter.ZPages/Implementation/ZPagesExporterEventSource.cs index f0b8dec0b5b..cba2dbffa2d 100644 --- a/src/OpenTelemetry.Exporter.ZPages/Implementation/ZPagesExporterEventSource.cs +++ b/src/OpenTelemetry.Exporter.ZPages/Implementation/ZPagesExporterEventSource.cs @@ -24,7 +24,7 @@ namespace OpenTelemetry.Exporter.ZPages.Implementation /// EventSource events emitted from the project. /// [EventSource(Name = "OpenTelemetry-Exporter-ZPages")] - internal class ZPagesExporterEventSource : EventSource + internal sealed class ZPagesExporterEventSource : EventSource { public static ZPagesExporterEventSource Log = new(); diff --git a/src/OpenTelemetry.Exporter.ZPages/Implementation/ZPagesStatsBuilder.cs b/src/OpenTelemetry.Exporter.ZPages/Implementation/ZPagesStatsBuilder.cs index 03648422ef3..2409d02ef86 100644 --- a/src/OpenTelemetry.Exporter.ZPages/Implementation/ZPagesStatsBuilder.cs +++ b/src/OpenTelemetry.Exporter.ZPages/Implementation/ZPagesStatsBuilder.cs @@ -16,7 +16,7 @@ namespace OpenTelemetry.Exporter.ZPages.Implementation { - internal class ZPagesStatsBuilder + internal sealed class ZPagesStatsBuilder { public const string ContentType = "text/html"; } diff --git a/src/OpenTelemetry.Exporter.Zipkin/Implementation/ZipkinEndpoint.cs b/src/OpenTelemetry.Exporter.Zipkin/Implementation/ZipkinEndpoint.cs index db850fc3f5c..0d4fc8705d3 100644 --- a/src/OpenTelemetry.Exporter.Zipkin/Implementation/ZipkinEndpoint.cs +++ b/src/OpenTelemetry.Exporter.Zipkin/Implementation/ZipkinEndpoint.cs @@ -19,7 +19,7 @@ namespace OpenTelemetry.Exporter.Zipkin.Implementation { - internal class ZipkinEndpoint + internal sealed class ZipkinEndpoint { public ZipkinEndpoint(string serviceName) : this(serviceName, null, null, null, null) diff --git a/src/OpenTelemetry.Exporter.Zipkin/Implementation/ZipkinExporterEventSource.cs b/src/OpenTelemetry.Exporter.Zipkin/Implementation/ZipkinExporterEventSource.cs index a7c4d317b3e..c60bc053a01 100644 --- a/src/OpenTelemetry.Exporter.Zipkin/Implementation/ZipkinExporterEventSource.cs +++ b/src/OpenTelemetry.Exporter.Zipkin/Implementation/ZipkinExporterEventSource.cs @@ -24,7 +24,7 @@ namespace OpenTelemetry.Exporter.Zipkin.Implementation /// EventSource events emitted from the project. /// [EventSource(Name = "OpenTelemetry-Exporter-Zipkin")] - internal class ZipkinExporterEventSource : EventSource + internal sealed class ZipkinExporterEventSource : EventSource { public static ZipkinExporterEventSource Log = new(); diff --git a/src/OpenTelemetry.Extensions.Hosting/Implementation/HostingExtensionsEventSource.cs b/src/OpenTelemetry.Extensions.Hosting/Implementation/HostingExtensionsEventSource.cs index fc20083a801..164695c6144 100644 --- a/src/OpenTelemetry.Extensions.Hosting/Implementation/HostingExtensionsEventSource.cs +++ b/src/OpenTelemetry.Extensions.Hosting/Implementation/HostingExtensionsEventSource.cs @@ -24,7 +24,7 @@ namespace OpenTelemetry.Extensions.Hosting.Implementation /// EventSource events emitted from the project. /// [EventSource(Name = "OpenTelemetry-Extensions-Hosting")] - internal class HostingExtensionsEventSource : EventSource + internal sealed class HostingExtensionsEventSource : EventSource { public static HostingExtensionsEventSource Log = new(); diff --git a/src/OpenTelemetry.Extensions.Propagators/OpenTelemetryPropagatorsEventSource.cs b/src/OpenTelemetry.Extensions.Propagators/OpenTelemetryPropagatorsEventSource.cs index fc22c92e87f..1e3163a0b12 100644 --- a/src/OpenTelemetry.Extensions.Propagators/OpenTelemetryPropagatorsEventSource.cs +++ b/src/OpenTelemetry.Extensions.Propagators/OpenTelemetryPropagatorsEventSource.cs @@ -24,7 +24,7 @@ namespace OpenTelemetry.Internal /// This is used for internal logging of this library. /// [EventSource(Name = "OpenTelemetry.Extensions.Propagators")] - internal class OpenTelemetryPropagatorsEventSource : EventSource + internal sealed class OpenTelemetryPropagatorsEventSource : EventSource { public static OpenTelemetryPropagatorsEventSource Log = new(); diff --git a/src/OpenTelemetry.Instrumentation.AspNetCore/AspNetCoreInstrumentation.cs b/src/OpenTelemetry.Instrumentation.AspNetCore/AspNetCoreInstrumentation.cs index 0503813e69c..190a305aedf 100644 --- a/src/OpenTelemetry.Instrumentation.AspNetCore/AspNetCoreInstrumentation.cs +++ b/src/OpenTelemetry.Instrumentation.AspNetCore/AspNetCoreInstrumentation.cs @@ -22,7 +22,7 @@ namespace OpenTelemetry.Instrumentation.AspNetCore /// /// Asp.Net Core Requests instrumentation. /// - internal class AspNetCoreInstrumentation : IDisposable + internal sealed class AspNetCoreInstrumentation : IDisposable { private static readonly HashSet DiagnosticSourceEvents = new() { diff --git a/src/OpenTelemetry.Instrumentation.AspNetCore/AspNetCoreMetrics.cs b/src/OpenTelemetry.Instrumentation.AspNetCore/AspNetCoreMetrics.cs index 7f4c2292091..c14b6628eca 100644 --- a/src/OpenTelemetry.Instrumentation.AspNetCore/AspNetCoreMetrics.cs +++ b/src/OpenTelemetry.Instrumentation.AspNetCore/AspNetCoreMetrics.cs @@ -24,7 +24,7 @@ namespace OpenTelemetry.Instrumentation.AspNetCore /// /// Asp.Net Core Requests instrumentation. /// - internal class AspNetCoreMetrics : IDisposable + internal sealed class AspNetCoreMetrics : IDisposable { internal static readonly AssemblyName AssemblyName = typeof(HttpInListener).Assembly.GetName(); internal static readonly string InstrumentationName = AssemblyName.Name; diff --git a/src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/AspNetCoreInstrumentationEventSource.cs b/src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/AspNetCoreInstrumentationEventSource.cs index c3929f6845b..b78ab6953d0 100644 --- a/src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/AspNetCoreInstrumentationEventSource.cs +++ b/src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/AspNetCoreInstrumentationEventSource.cs @@ -24,7 +24,7 @@ namespace OpenTelemetry.Instrumentation.AspNetCore.Implementation /// EventSource events emitted from the project. /// [EventSource(Name = "OpenTelemetry-Instrumentation-AspNetCore")] - internal class AspNetCoreInstrumentationEventSource : EventSource + internal sealed class AspNetCoreInstrumentationEventSource : EventSource { public static AspNetCoreInstrumentationEventSource Log = new(); diff --git a/src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/HttpInMetricsListener.cs b/src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/HttpInMetricsListener.cs index 030c5648623..802feedec04 100644 --- a/src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/HttpInMetricsListener.cs +++ b/src/OpenTelemetry.Instrumentation.AspNetCore/Implementation/HttpInMetricsListener.cs @@ -24,7 +24,7 @@ namespace OpenTelemetry.Instrumentation.AspNetCore.Implementation { - internal class HttpInMetricsListener : ListenerHandler + internal sealed class HttpInMetricsListener : ListenerHandler { private const string OnStopEvent = "Microsoft.AspNetCore.Hosting.HttpRequestIn.Stop"; diff --git a/src/OpenTelemetry.Instrumentation.GrpcNetClient/GrpcClientInstrumentation.cs b/src/OpenTelemetry.Instrumentation.GrpcNetClient/GrpcClientInstrumentation.cs index 75242e5a876..df827346111 100644 --- a/src/OpenTelemetry.Instrumentation.GrpcNetClient/GrpcClientInstrumentation.cs +++ b/src/OpenTelemetry.Instrumentation.GrpcNetClient/GrpcClientInstrumentation.cs @@ -21,7 +21,7 @@ namespace OpenTelemetry.Instrumentation.GrpcNetClient /// /// GrpcClient instrumentation. /// - internal class GrpcClientInstrumentation : IDisposable + internal sealed class GrpcClientInstrumentation : IDisposable { private readonly DiagnosticSourceSubscriber diagnosticSourceSubscriber; diff --git a/src/OpenTelemetry.Instrumentation.GrpcNetClient/Implementation/GrpcInstrumentationEventSource.cs b/src/OpenTelemetry.Instrumentation.GrpcNetClient/Implementation/GrpcInstrumentationEventSource.cs index 340ddb73603..c171c21c59b 100644 --- a/src/OpenTelemetry.Instrumentation.GrpcNetClient/Implementation/GrpcInstrumentationEventSource.cs +++ b/src/OpenTelemetry.Instrumentation.GrpcNetClient/Implementation/GrpcInstrumentationEventSource.cs @@ -24,7 +24,7 @@ namespace OpenTelemetry.Instrumentation.GrpcNetClient.Implementation /// EventSource events emitted from the project. /// [EventSource(Name = "OpenTelemetry-Instrumentation-Grpc")] - internal class GrpcInstrumentationEventSource : EventSource + internal sealed class GrpcInstrumentationEventSource : EventSource { public static GrpcInstrumentationEventSource Log = new(); diff --git a/src/OpenTelemetry.Instrumentation.Http/HttpClientInstrumentation.cs b/src/OpenTelemetry.Instrumentation.Http/HttpClientInstrumentation.cs index 09fc1f3c0ae..4c7a42a0cb4 100644 --- a/src/OpenTelemetry.Instrumentation.Http/HttpClientInstrumentation.cs +++ b/src/OpenTelemetry.Instrumentation.Http/HttpClientInstrumentation.cs @@ -21,7 +21,7 @@ namespace OpenTelemetry.Instrumentation.Http /// /// HttpClient instrumentation. /// - internal class HttpClientInstrumentation : IDisposable + internal sealed class HttpClientInstrumentation : IDisposable { private readonly DiagnosticSourceSubscriber diagnosticSourceSubscriber; diff --git a/src/OpenTelemetry.Instrumentation.Http/HttpClientMetrics.cs b/src/OpenTelemetry.Instrumentation.Http/HttpClientMetrics.cs index c0502219e3b..27b39f5da17 100644 --- a/src/OpenTelemetry.Instrumentation.Http/HttpClientMetrics.cs +++ b/src/OpenTelemetry.Instrumentation.Http/HttpClientMetrics.cs @@ -24,7 +24,7 @@ namespace OpenTelemetry.Instrumentation.Http /// /// HttpClient instrumentation. /// - internal class HttpClientMetrics : IDisposable + internal sealed class HttpClientMetrics : IDisposable { internal static readonly AssemblyName AssemblyName = typeof(HttpClientMetrics).Assembly.GetName(); internal static readonly string InstrumentationName = AssemblyName.Name; diff --git a/src/OpenTelemetry.Instrumentation.Http/Implementation/HttpHandlerMetricsDiagnosticListener.cs b/src/OpenTelemetry.Instrumentation.Http/Implementation/HttpHandlerMetricsDiagnosticListener.cs index 2e8234f00db..8b2ebf0a678 100644 --- a/src/OpenTelemetry.Instrumentation.Http/Implementation/HttpHandlerMetricsDiagnosticListener.cs +++ b/src/OpenTelemetry.Instrumentation.Http/Implementation/HttpHandlerMetricsDiagnosticListener.cs @@ -22,7 +22,7 @@ namespace OpenTelemetry.Instrumentation.Http.Implementation { - internal class HttpHandlerMetricsDiagnosticListener : ListenerHandler + internal sealed class HttpHandlerMetricsDiagnosticListener : ListenerHandler { internal const string OnStopEvent = "System.Net.Http.HttpRequestOut.Stop"; diff --git a/src/OpenTelemetry.Instrumentation.Http/Implementation/HttpInstrumentationEventSource.cs b/src/OpenTelemetry.Instrumentation.Http/Implementation/HttpInstrumentationEventSource.cs index 746d4d873a0..a0a5e6fa967 100644 --- a/src/OpenTelemetry.Instrumentation.Http/Implementation/HttpInstrumentationEventSource.cs +++ b/src/OpenTelemetry.Instrumentation.Http/Implementation/HttpInstrumentationEventSource.cs @@ -24,7 +24,7 @@ namespace OpenTelemetry.Instrumentation.Http.Implementation /// EventSource events emitted from the project. /// [EventSource(Name = "OpenTelemetry-Instrumentation-Http")] - internal class HttpInstrumentationEventSource : EventSource + internal sealed class HttpInstrumentationEventSource : EventSource { public static HttpInstrumentationEventSource Log = new(); diff --git a/src/OpenTelemetry.Instrumentation.SqlClient/Implementation/SqlActivitySourceHelper.cs b/src/OpenTelemetry.Instrumentation.SqlClient/Implementation/SqlActivitySourceHelper.cs index 95c68fda943..fbf4fb7d83a 100644 --- a/src/OpenTelemetry.Instrumentation.SqlClient/Implementation/SqlActivitySourceHelper.cs +++ b/src/OpenTelemetry.Instrumentation.SqlClient/Implementation/SqlActivitySourceHelper.cs @@ -25,7 +25,7 @@ namespace OpenTelemetry.Instrumentation.SqlClient.Implementation /// Helper class to hold common properties used by both SqlClientDiagnosticListener on .NET Core /// and SqlEventSourceListener on .NET Framework. /// - internal class SqlActivitySourceHelper + internal sealed class SqlActivitySourceHelper { public const string MicrosoftSqlServerDatabaseSystemName = "mssql"; diff --git a/src/OpenTelemetry.Instrumentation.SqlClient/Implementation/SqlClientInstrumentationEventSource.cs b/src/OpenTelemetry.Instrumentation.SqlClient/Implementation/SqlClientInstrumentationEventSource.cs index 2011b4b74bf..31a7a9737bf 100644 --- a/src/OpenTelemetry.Instrumentation.SqlClient/Implementation/SqlClientInstrumentationEventSource.cs +++ b/src/OpenTelemetry.Instrumentation.SqlClient/Implementation/SqlClientInstrumentationEventSource.cs @@ -24,7 +24,7 @@ namespace OpenTelemetry.Instrumentation.SqlClient.Implementation /// EventSource events emitted from the project. /// [EventSource(Name = "OpenTelemetry-Instrumentation-SqlClient")] - internal class SqlClientInstrumentationEventSource : EventSource + internal sealed class SqlClientInstrumentationEventSource : EventSource { public static SqlClientInstrumentationEventSource Log = new(); diff --git a/src/OpenTelemetry.Instrumentation.SqlClient/SqlClientInstrumentation.cs b/src/OpenTelemetry.Instrumentation.SqlClient/SqlClientInstrumentation.cs index 5b293bf76d0..0b4469aefe3 100644 --- a/src/OpenTelemetry.Instrumentation.SqlClient/SqlClientInstrumentation.cs +++ b/src/OpenTelemetry.Instrumentation.SqlClient/SqlClientInstrumentation.cs @@ -21,7 +21,7 @@ namespace OpenTelemetry.Instrumentation.SqlClient /// /// SqlClient instrumentation. /// - internal class SqlClientInstrumentation : IDisposable + internal sealed class SqlClientInstrumentation : IDisposable { internal const string SqlClientDiagnosticListenerName = "SqlClientDiagnosticListener"; diff --git a/src/OpenTelemetry.Instrumentation.SqlClient/SqlClientInstrumentationOptions.cs b/src/OpenTelemetry.Instrumentation.SqlClient/SqlClientInstrumentationOptions.cs index 3074bf2b372..b413952e6cf 100644 --- a/src/OpenTelemetry.Instrumentation.SqlClient/SqlClientInstrumentationOptions.cs +++ b/src/OpenTelemetry.Instrumentation.SqlClient/SqlClientInstrumentationOptions.cs @@ -270,7 +270,7 @@ internal void AddConnectionLevelDetailsToActivity(string dataSource, Activity sq } } - internal class SqlConnectionDetails + internal sealed class SqlConnectionDetails { public string ServerHostName { get; set; } diff --git a/src/OpenTelemetry.Shims.OpenTracing/ScopeManagerShim.cs b/src/OpenTelemetry.Shims.OpenTracing/ScopeManagerShim.cs index a4039d88a41..0617a16cbe7 100644 --- a/src/OpenTelemetry.Shims.OpenTracing/ScopeManagerShim.cs +++ b/src/OpenTelemetry.Shims.OpenTracing/ScopeManagerShim.cs @@ -95,7 +95,7 @@ public IScope Activate(ISpan span, bool finishSpanOnDispose) return instrumentation; } - private class ScopeInstrumentation : IScope + private sealed class ScopeInstrumentation : IScope { private readonly Action disposeAction; diff --git a/src/OpenTelemetry/DiagnosticSourceInstrumentation/DiagnosticSourceListener.cs b/src/OpenTelemetry/DiagnosticSourceInstrumentation/DiagnosticSourceListener.cs index 43a78008272..9e8f68c2498 100644 --- a/src/OpenTelemetry/DiagnosticSourceInstrumentation/DiagnosticSourceListener.cs +++ b/src/OpenTelemetry/DiagnosticSourceInstrumentation/DiagnosticSourceListener.cs @@ -21,7 +21,7 @@ namespace OpenTelemetry.Instrumentation { - internal class DiagnosticSourceListener : IObserver> + internal sealed class DiagnosticSourceListener : IObserver> { private readonly ListenerHandler handler; diff --git a/src/OpenTelemetry/DiagnosticSourceInstrumentation/InstrumentationEventSource.cs b/src/OpenTelemetry/DiagnosticSourceInstrumentation/InstrumentationEventSource.cs index 0590edb5111..6e1760bfccd 100644 --- a/src/OpenTelemetry/DiagnosticSourceInstrumentation/InstrumentationEventSource.cs +++ b/src/OpenTelemetry/DiagnosticSourceInstrumentation/InstrumentationEventSource.cs @@ -24,7 +24,7 @@ namespace OpenTelemetry.Instrumentation /// EventSource events emitted from the project. /// [EventSource(Name = "OpenTelemetry-Instrumentation")] - internal class InstrumentationEventSource : EventSource + internal sealed class InstrumentationEventSource : EventSource { public static InstrumentationEventSource Log = new(); diff --git a/src/OpenTelemetry/DiagnosticSourceInstrumentation/PropertyFetcher.cs b/src/OpenTelemetry/DiagnosticSourceInstrumentation/PropertyFetcher.cs index d2ec900b051..6c1657fe657 100644 --- a/src/OpenTelemetry/DiagnosticSourceInstrumentation/PropertyFetcher.cs +++ b/src/OpenTelemetry/DiagnosticSourceInstrumentation/PropertyFetcher.cs @@ -25,7 +25,7 @@ namespace OpenTelemetry.Instrumentation /// PropertyFetcher fetches a property from an object. /// /// The type of the property being fetched. - internal class PropertyFetcher + internal sealed class PropertyFetcher { private readonly string propertyName; private PropertyFetch innerFetcher; diff --git a/src/OpenTelemetry/Internal/OpenTelemetrySdkEventSource.cs b/src/OpenTelemetry/Internal/OpenTelemetrySdkEventSource.cs index 5aa859b5715..063e2fcbe2a 100644 --- a/src/OpenTelemetry/Internal/OpenTelemetrySdkEventSource.cs +++ b/src/OpenTelemetry/Internal/OpenTelemetrySdkEventSource.cs @@ -29,7 +29,7 @@ namespace OpenTelemetry.Internal /// EventSource implementation for OpenTelemetry SDK implementation. /// [EventSource(Name = "OpenTelemetry-Sdk")] - internal class OpenTelemetrySdkEventSource : EventSource + internal sealed class OpenTelemetrySdkEventSource : EventSource { public static OpenTelemetrySdkEventSource Log = new(); #if DEBUG diff --git a/src/OpenTelemetry/Internal/SelfDiagnosticsConfigParser.cs b/src/OpenTelemetry/Internal/SelfDiagnosticsConfigParser.cs index 91dd32fee1b..d517f8667f0 100644 --- a/src/OpenTelemetry/Internal/SelfDiagnosticsConfigParser.cs +++ b/src/OpenTelemetry/Internal/SelfDiagnosticsConfigParser.cs @@ -22,7 +22,7 @@ namespace OpenTelemetry.Internal { - internal class SelfDiagnosticsConfigParser + internal sealed class SelfDiagnosticsConfigParser { public const string ConfigFileName = "OTEL_DIAGNOSTICS.json"; private const int FileSizeLowerLimit = 1024; // Lower limit for log file size in KB: 1MB diff --git a/src/OpenTelemetry/Metrics/CompositeMetricReader.cs b/src/OpenTelemetry/Metrics/CompositeMetricReader.cs index 4e9e5d2597f..5f778b3a836 100644 --- a/src/OpenTelemetry/Metrics/CompositeMetricReader.cs +++ b/src/OpenTelemetry/Metrics/CompositeMetricReader.cs @@ -179,7 +179,7 @@ public bool MoveNext() } } - internal class DoublyLinkedListNode + internal sealed class DoublyLinkedListNode { public readonly MetricReader Value; diff --git a/src/OpenTelemetry/Metrics/ExponentialBucketHistogram.cs b/src/OpenTelemetry/Metrics/ExponentialBucketHistogram.cs index 8fe69979b33..0f83121bea1 100644 --- a/src/OpenTelemetry/Metrics/ExponentialBucketHistogram.cs +++ b/src/OpenTelemetry/Metrics/ExponentialBucketHistogram.cs @@ -26,7 +26,7 @@ namespace OpenTelemetry.Metrics; /// identified by Bucket[index] = ( base ^ index, base ^ (index + 1) ], /// where index is an integer. /// -internal class ExponentialBucketHistogram +internal sealed class ExponentialBucketHistogram { private int scale; private double scalingFactor; // 2 ^ scale / log(2) diff --git a/src/OpenTelemetry/Metrics/ExponentialBucketHistogramConfiguration.cs b/src/OpenTelemetry/Metrics/ExponentialBucketHistogramConfiguration.cs index 389b2e0e4b0..53e8510d9ff 100644 --- a/src/OpenTelemetry/Metrics/ExponentialBucketHistogramConfiguration.cs +++ b/src/OpenTelemetry/Metrics/ExponentialBucketHistogramConfiguration.cs @@ -19,7 +19,7 @@ namespace OpenTelemetry.Metrics; /// /// Stores configuration for a histogram metric stream with exponential bucket boundaries. /// -internal class ExponentialBucketHistogramConfiguration : MetricStreamConfiguration +internal sealed class ExponentialBucketHistogramConfiguration : MetricStreamConfiguration { /// /// Gets or sets the maximum number of buckets in each of the positive and negative ranges, not counting the special zero bucket. diff --git a/src/OpenTelemetry/Metrics/StringArrayEqualityComparer.cs b/src/OpenTelemetry/Metrics/StringArrayEqualityComparer.cs index 6a91f201eae..579325cef2a 100644 --- a/src/OpenTelemetry/Metrics/StringArrayEqualityComparer.cs +++ b/src/OpenTelemetry/Metrics/StringArrayEqualityComparer.cs @@ -19,7 +19,7 @@ namespace OpenTelemetry.Metrics { - internal class StringArrayEqualityComparer : IEqualityComparer + internal sealed class StringArrayEqualityComparer : IEqualityComparer { public bool Equals(string[] strings1, string[] strings2) { diff --git a/src/OpenTelemetry/Metrics/ThreadStaticStorage.cs b/src/OpenTelemetry/Metrics/ThreadStaticStorage.cs index e473cfdb8af..cee643afa99 100644 --- a/src/OpenTelemetry/Metrics/ThreadStaticStorage.cs +++ b/src/OpenTelemetry/Metrics/ThreadStaticStorage.cs @@ -21,7 +21,7 @@ namespace OpenTelemetry.Metrics { - internal class ThreadStaticStorage + internal sealed class ThreadStaticStorage { private const int MaxTagCacheSize = 8; @@ -150,7 +150,7 @@ internal void CloneKeysAndValues(string[] inputTagKeys, object[] inputTagValues, } } - internal class TagStorage + internal sealed class TagStorage { // Used to split into Key sequence, Value sequence. internal readonly string[] TagKeys;