diff --git a/examples/Console/TestConsoleExporter.cs b/examples/Console/TestConsoleExporter.cs index 934236ae9f7..9929beab33b 100644 --- a/examples/Console/TestConsoleExporter.cs +++ b/examples/Console/TestConsoleExporter.cs @@ -37,7 +37,7 @@ private static object RunWithActivitySource() { // Enable OpenTelemetry for the sources "Samples.SampleServer" and "Samples.SampleClient" // and use Console exporter. - using var openTelemetry = Sdk.CreateTracerProviderBuilder() + using var tracerProvider = Sdk.CreateTracerProviderBuilder() .AddSource("Samples.SampleClient", "Samples.SampleServer") .SetResourceBuilder(ResourceBuilder.CreateDefault().AddService("console-test")) .AddProcessor(new MyProcessor()) // This must be added before ConsoleExporter diff --git a/examples/Console/TestGrpcNetClient.cs b/examples/Console/TestGrpcNetClient.cs index a15bd6fbde3..b1d884aa789 100644 --- a/examples/Console/TestGrpcNetClient.cs +++ b/examples/Console/TestGrpcNetClient.cs @@ -41,7 +41,7 @@ internal static object Run() // // dotnet run grpc - using var openTelemetry = Sdk.CreateTracerProviderBuilder() + using var tracerProvider = Sdk.CreateTracerProviderBuilder() .AddGrpcClientInstrumentation() .AddSource("grpc-net-client-test") .AddConsoleExporter() diff --git a/examples/Console/TestHttpClient.cs b/examples/Console/TestHttpClient.cs index 78d0047a993..734cae06b58 100644 --- a/examples/Console/TestHttpClient.cs +++ b/examples/Console/TestHttpClient.cs @@ -32,7 +32,7 @@ internal static object Run() { System.Console.WriteLine("Hello World!"); - using var openTelemetry = Sdk.CreateTracerProviderBuilder() + using var tracerProvider = Sdk.CreateTracerProviderBuilder() .AddHttpClientInstrumentation() .SetResourceBuilder(ResourceBuilder.CreateDefault().AddService("http-service-example")) .AddSource("http-client-test") diff --git a/examples/Console/TestInMemoryExporter.cs b/examples/Console/TestInMemoryExporter.cs index bbebdaf46a0..b7f0f956747 100644 --- a/examples/Console/TestInMemoryExporter.cs +++ b/examples/Console/TestInMemoryExporter.cs @@ -49,7 +49,7 @@ private static void RunWithActivitySource(ICollection exportedItems) { // Enable OpenTelemetry for the sources "Samples.SampleServer" and "Samples.SampleClient" // and use InMemory exporter. - using var openTelemetry = Sdk.CreateTracerProviderBuilder() + using var tracerProvider = Sdk.CreateTracerProviderBuilder() .AddSource("Samples.SampleClient", "Samples.SampleServer") .SetResourceBuilder(ResourceBuilder.CreateDefault().AddService("inmemory-test")) .AddInMemoryExporter(exportedItems) diff --git a/examples/Console/TestJaegerExporter.cs b/examples/Console/TestJaegerExporter.cs index 660723eb1b5..2c67e9bff66 100644 --- a/examples/Console/TestJaegerExporter.cs +++ b/examples/Console/TestJaegerExporter.cs @@ -55,7 +55,7 @@ internal static object RunWithActivity(string host, int port) { // Enable OpenTelemetry for the sources "Samples.SampleServer" and "Samples.SampleClient" // and use the Jaeger exporter. - using var openTelemetry = Sdk.CreateTracerProviderBuilder() + using var tracerProvider = Sdk.CreateTracerProviderBuilder() .SetResourceBuilder(ResourceBuilder.CreateDefault().AddService("jaeger-test")) .AddSource("Samples.SampleClient", "Samples.SampleServer") .AddJaegerExporter(o => diff --git a/examples/Console/TestOpenTracingShim.cs b/examples/Console/TestOpenTracingShim.cs index a5d75eac7dc..a450a9c0360 100644 --- a/examples/Console/TestOpenTracingShim.cs +++ b/examples/Console/TestOpenTracingShim.cs @@ -29,7 +29,7 @@ internal static object Run(OpenTracingShimOptions options) { // Enable OpenTelemetry for the source "MyCompany.MyProduct.MyWebServer" // and use Console exporter. - using var openTelemetry = Sdk.CreateTracerProviderBuilder() + using var tracerProvider = Sdk.CreateTracerProviderBuilder() .AddSource("MyCompany.MyProduct.MyWebServer") .SetResourceBuilder(ResourceBuilder.CreateDefault().AddService("MyServiceName")) .AddConsoleExporter() diff --git a/examples/Console/TestOtlpExporter.cs b/examples/Console/TestOtlpExporter.cs index 1dafc6c8d76..423949b3bdc 100644 --- a/examples/Console/TestOtlpExporter.cs +++ b/examples/Console/TestOtlpExporter.cs @@ -69,7 +69,7 @@ private static object RunWithActivitySource(string endpoint, string protocol) // Enable OpenTelemetry for the sources "Samples.SampleServer" and "Samples.SampleClient" // and use OTLP exporter. - using var openTelemetry = Sdk.CreateTracerProviderBuilder() + using var tracerProvider = Sdk.CreateTracerProviderBuilder() .AddSource("Samples.SampleClient", "Samples.SampleServer") .SetResourceBuilder(ResourceBuilder.CreateDefault().AddService("otlp-test")) .AddOtlpExporter(opt => diff --git a/examples/Console/TestRedis.cs b/examples/Console/TestRedis.cs index 12981cc7928..3306449810c 100644 --- a/examples/Console/TestRedis.cs +++ b/examples/Console/TestRedis.cs @@ -42,7 +42,7 @@ internal static object Run(string zipkinUri) var connection = ConnectionMultiplexer.Connect("localhost"); // Configure exporter to export traces to Zipkin - using var openTelemetry = Sdk.CreateTracerProviderBuilder() + using var tracerProvider = Sdk.CreateTracerProviderBuilder() .AddZipkinExporter(o => { o.Endpoint = new Uri(zipkinUri); diff --git a/examples/Console/TestZPagesExporter.cs b/examples/Console/TestZPagesExporter.cs index 3d70f4b447f..9d80e361f36 100644 --- a/examples/Console/TestZPagesExporter.cs +++ b/examples/Console/TestZPagesExporter.cs @@ -33,7 +33,7 @@ internal static object Run() // Start the server httpServer.Start(); - using var openTelemetry = Sdk.CreateTracerProviderBuilder() + using var tracerProvider = Sdk.CreateTracerProviderBuilder() .AddSource("zpages-test") .AddZPagesExporter(o => { diff --git a/examples/Console/TestZipkinExporter.cs b/examples/Console/TestZipkinExporter.cs index 5c750f63aa2..40c44551b84 100644 --- a/examples/Console/TestZipkinExporter.cs +++ b/examples/Console/TestZipkinExporter.cs @@ -37,7 +37,7 @@ internal static object Run(string zipkinUri) // Enable OpenTelemetry for the sources "Samples.SampleServer" and "Samples.SampleClient" // and use the Zipkin exporter. - using var openTelemetry = Sdk.CreateTracerProviderBuilder() + using var tracerProvider = Sdk.CreateTracerProviderBuilder() .AddSource("Samples.SampleClient", "Samples.SampleServer") .SetResourceBuilder(ResourceBuilder.CreateDefault().AddService("zipkin-test")) .AddZipkinExporter(o => diff --git a/test/OpenTelemetry.Exporter.OpenTelemetryProtocol.Tests/OtlpTraceExporterTests.cs b/test/OpenTelemetry.Exporter.OpenTelemetryProtocol.Tests/OtlpTraceExporterTests.cs index 360fc156e45..f89f2fb2e5a 100644 --- a/test/OpenTelemetry.Exporter.OpenTelemetryProtocol.Tests/OtlpTraceExporterTests.cs +++ b/test/OpenTelemetry.Exporter.OpenTelemetryProtocol.Tests/OtlpTraceExporterTests.cs @@ -324,7 +324,7 @@ public void UseOpenTelemetryProtocolActivityExporterWithCustomActivityProcessor( endCalled = true; }; - var openTelemetrySdk = Sdk.CreateTracerProviderBuilder() + var tracerProvider = Sdk.CreateTracerProviderBuilder() .AddSource(ActivitySourceName) .AddProcessor(testActivityProcessor) .AddOtlpExporter() diff --git a/test/OpenTelemetry.Exporter.ZPages.Tests/ZPagesExporterTests.cs b/test/OpenTelemetry.Exporter.ZPages.Tests/ZPagesExporterTests.cs index ac413ca0c6c..5713f3f9ef3 100644 --- a/test/OpenTelemetry.Exporter.ZPages.Tests/ZPagesExporterTests.cs +++ b/test/OpenTelemetry.Exporter.ZPages.Tests/ZPagesExporterTests.cs @@ -75,7 +75,7 @@ public void CheckingCustomActivityProcessor() endCalled = true; }; - using var openTelemetrySdk = Sdk.CreateTracerProviderBuilder() + using var tracerProvider = Sdk.CreateTracerProviderBuilder() .AddSource(ActivitySourceName) .AddProcessor(testActivityProcessor) .AddZPagesExporter() diff --git a/test/OpenTelemetry.Exporter.Zipkin.Tests/ZipkinExporterTests.cs b/test/OpenTelemetry.Exporter.Zipkin.Tests/ZipkinExporterTests.cs index 086685a0469..a547b09ba8a 100644 --- a/test/OpenTelemetry.Exporter.Zipkin.Tests/ZipkinExporterTests.cs +++ b/test/OpenTelemetry.Exporter.Zipkin.Tests/ZipkinExporterTests.cs @@ -112,7 +112,7 @@ public void SuppresssesInstrumentation() var zipkinExporter = new ZipkinExporter(exporterOptions); var exportActivityProcessor = new BatchActivityExportProcessor(zipkinExporter); - var openTelemetrySdk = Sdk.CreateTracerProviderBuilder() + var tracerProvider = Sdk.CreateTracerProviderBuilder() .AddSource(ActivitySourceName) .AddProcessor(testActivityProcessor) .AddProcessor(exportActivityProcessor) diff --git a/test/OpenTelemetry.Instrumentation.AspNet.Tests/HttpInListenerTests.cs b/test/OpenTelemetry.Instrumentation.AspNet.Tests/HttpInListenerTests.cs index d946617d849..465c3192173 100644 --- a/test/OpenTelemetry.Instrumentation.AspNet.Tests/HttpInListenerTests.cs +++ b/test/OpenTelemetry.Instrumentation.AspNet.Tests/HttpInListenerTests.cs @@ -58,7 +58,7 @@ public void AspNetRequestsAreCollectedSuccessfully( string filter = null, bool recordException = false) { - IDisposable openTelemetry = null; + IDisposable tracerProvider = null; RouteData routeData; switch (routeType) { @@ -118,7 +118,7 @@ public void AspNetRequestsAreCollectedSuccessfully( List exportedItems = new List(16); Sdk.SetDefaultTextMapPropagator(new TraceContextPropagator()); - using (openTelemetry = Sdk.CreateTracerProviderBuilder() + using (tracerProvider = Sdk.CreateTracerProviderBuilder() .AddAspNetInstrumentation((options) => { options.Filter = httpContext => @@ -275,7 +275,7 @@ public void ExtractContextIrrespectiveOfSamplingDecision(SamplingDecision sampli var activityProcessor = new Mock>(); Sdk.SetDefaultTextMapPropagator(propagator.Object); - using (var openTelemetry = Sdk.CreateTracerProviderBuilder() + using (var tracerProvider = Sdk.CreateTracerProviderBuilder() .SetSampler(new TestSampler(samplingDecision)) .AddAspNetInstrumentation() .AddProcessor(activityProcessor.Object).Build()) @@ -312,7 +312,7 @@ public void ExtractContextIrrespectiveOfTheFilterApplied() bool isFilterCalled = false; var activityProcessor = new Mock>(); Sdk.SetDefaultTextMapPropagator(propagator.Object); - using (var openTelemetry = Sdk.CreateTracerProviderBuilder() + using (var tracerProvider = Sdk.CreateTracerProviderBuilder() .AddAspNetInstrumentation(options => { options.Filter = context => diff --git a/test/OpenTelemetry.Instrumentation.AspNetCore.Tests/BasicTests.cs b/test/OpenTelemetry.Instrumentation.AspNetCore.Tests/BasicTests.cs index 425bce8a152..db77e75cc2c 100644 --- a/test/OpenTelemetry.Instrumentation.AspNetCore.Tests/BasicTests.cs +++ b/test/OpenTelemetry.Instrumentation.AspNetCore.Tests/BasicTests.cs @@ -50,7 +50,7 @@ public sealed class BasicTests : IClassFixture>, IDisposable { private readonly WebApplicationFactory factory; - private TracerProvider openTelemetrySdk = null; + private TracerProvider tracerProvider = null; public BasicTests(WebApplicationFactory factory) { @@ -70,7 +70,7 @@ public async Task StatusIsUnsetOn200Response() var activityProcessor = new Mock>(); void ConfigureTestServices(IServiceCollection services) { - this.openTelemetrySdk = Sdk.CreateTracerProviderBuilder() + this.tracerProvider = Sdk.CreateTracerProviderBuilder() .AddAspNetCoreInstrumentation() .AddProcessor(activityProcessor.Object) .Build(); @@ -114,7 +114,7 @@ public async Task SuccessfulTemplateControllerCallGeneratesASpan(bool shouldEnri activityProcessor.Setup(x => x.OnStart(It.IsAny())).Callback(c => c.SetTag("enriched", "no")); void ConfigureTestServices(IServiceCollection services) { - this.openTelemetrySdk = Sdk.CreateTracerProviderBuilder() + this.tracerProvider = Sdk.CreateTracerProviderBuilder() .AddAspNetCoreInstrumentation(options => { if (shouldEnrich) @@ -163,7 +163,7 @@ public async Task SuccessfulTemplateControllerCallUsesParentContext() .WithWebHostBuilder(builder => builder.ConfigureTestServices(services => { - this.openTelemetrySdk = Sdk.CreateTracerProviderBuilder().AddAspNetCoreInstrumentation() + this.tracerProvider = Sdk.CreateTracerProviderBuilder().AddAspNetCoreInstrumentation() .AddProcessor(activityProcessor.Object) .Build(); }))) @@ -225,7 +225,7 @@ public async Task CustomPropagator() builder.ConfigureTestServices(services => { Sdk.SetDefaultTextMapPropagator(propagator.Object); - this.openTelemetrySdk = Sdk.CreateTracerProviderBuilder() + this.tracerProvider = Sdk.CreateTracerProviderBuilder() .AddAspNetCoreInstrumentation() .AddProcessor(activityProcessor.Object) .Build(); @@ -286,7 +286,7 @@ public async Task RequestNotCollectedWhenFilterIsApplied() void ConfigureTestServices(IServiceCollection services) { - this.openTelemetrySdk = Sdk.CreateTracerProviderBuilder() + this.tracerProvider = Sdk.CreateTracerProviderBuilder() .AddAspNetCoreInstrumentation((opt) => opt.Filter = (ctx) => ctx.Request.Path != "/api/values/2") .AddProcessor(activityProcessor.Object) .Build(); @@ -330,7 +330,7 @@ public async Task RequestNotCollectedWhenFilterThrowException() void ConfigureTestServices(IServiceCollection services) { - this.openTelemetrySdk = Sdk.CreateTracerProviderBuilder() + this.tracerProvider = Sdk.CreateTracerProviderBuilder() .AddAspNetCoreInstrumentation((opt) => opt.Filter = (ctx) => { if (ctx.Request.Path == "/api/values/2") @@ -403,7 +403,7 @@ public async Task ExtractContextIrrespectiveOfSamplingDecision(SamplingDecision .WithWebHostBuilder(builder => builder.ConfigureTestServices(services => { - this.openTelemetrySdk = Sdk.CreateTracerProviderBuilder() + this.tracerProvider = Sdk.CreateTracerProviderBuilder() .SetSampler(new TestSampler(samplingDecision)) .AddAspNetCoreInstrumentation() .Build(); @@ -462,7 +462,7 @@ public async Task ExtractContextIrrespectiveOfTheFilterApplied() .WithWebHostBuilder(builder => builder.ConfigureTestServices(services => { - this.openTelemetrySdk = Sdk.CreateTracerProviderBuilder() + this.tracerProvider = Sdk.CreateTracerProviderBuilder() .AddAspNetCoreInstrumentation(options => { options.Filter = context => @@ -522,7 +522,7 @@ public async Task BaggageClearedWhenActivityStopped() void ConfigureTestServices(IServiceCollection services) { - this.openTelemetrySdk = Sdk.CreateTracerProviderBuilder() + this.tracerProvider = Sdk.CreateTracerProviderBuilder() .AddAspNetCoreInstrumentation(new AspNetCoreInstrumentation( new TestHttpInListener(new AspNetCoreInstrumentationOptions()) { @@ -572,7 +572,7 @@ public async Task FilterAndEnrichAreOnlyCalledWhenSampled(SamplingDecision sampl bool enrichCalled = false; void ConfigureTestServices(IServiceCollection services) { - this.openTelemetrySdk = Sdk.CreateTracerProviderBuilder() + this.tracerProvider = Sdk.CreateTracerProviderBuilder() .SetSampler(new TestSampler(samplingDecision)) .AddAspNetCoreInstrumentation(options => { @@ -605,7 +605,7 @@ void ConfigureTestServices(IServiceCollection services) public void Dispose() { - this.openTelemetrySdk?.Dispose(); + this.tracerProvider?.Dispose(); } private static void WaitForProcessorInvocations(Mock> activityProcessor, int invocationCount) diff --git a/test/OpenTelemetry.Instrumentation.Http.Tests/HttpWebRequestTests.Basic.netfx.cs b/test/OpenTelemetry.Instrumentation.Http.Tests/HttpWebRequestTests.Basic.netfx.cs index affd904cad0..620438e262e 100644 --- a/test/OpenTelemetry.Instrumentation.Http.Tests/HttpWebRequestTests.Basic.netfx.cs +++ b/test/OpenTelemetry.Instrumentation.Http.Tests/HttpWebRequestTests.Basic.netfx.cs @@ -61,7 +61,7 @@ public void Dispose() public async Task HttpWebRequestInstrumentationInjectsHeadersAsync() { var activityProcessor = new Mock>(); - using var shutdownSignal = Sdk.CreateTracerProviderBuilder() + using var tracerProvider = Sdk.CreateTracerProviderBuilder() .AddProcessor(activityProcessor.Object) .AddHttpClientInstrumentation() .Build(); @@ -108,7 +108,7 @@ public async Task HttpWebRequestInstrumentationInjectsHeadersAsyncWhenActivityIs }); Sdk.SetDefaultTextMapPropagator(propagator.Object); - using var shutdownSignal = Sdk.CreateTracerProviderBuilder() + using var tracerProvider = Sdk.CreateTracerProviderBuilder() .AddProcessor(activityProcessor.Object) .AddHttpClientInstrumentation() .Build(); @@ -155,7 +155,7 @@ public async Task HttpWebRequestInstrumentationInjectsHeadersAsync_CustomFormat( var activityProcessor = new Mock>(); Sdk.SetDefaultTextMapPropagator(propagator.Object); - using var shutdownSignal = Sdk.CreateTracerProviderBuilder() + using var tracerProvider = Sdk.CreateTracerProviderBuilder() .AddProcessor(activityProcessor.Object) .AddHttpClientInstrumentation() .Build(); @@ -199,7 +199,7 @@ public async Task HttpWebRequestInstrumentationInjectsHeadersAsync_CustomFormat( public async Task HttpWebRequestInstrumentationBacksOffIfAlreadyInstrumented() { var activityProcessor = new Mock>(); - using var shutdownSignal = Sdk.CreateTracerProviderBuilder() + using var tracerProvider = Sdk.CreateTracerProviderBuilder() .AddProcessor(activityProcessor.Object) .AddHttpClientInstrumentation() .Build(); @@ -222,7 +222,7 @@ public async Task HttpWebRequestInstrumentationBacksOffIfAlreadyInstrumented() public async Task RequestNotCollectedWhenInstrumentationFilterApplied() { var activityProcessor = new Mock>(); - using var shutdownSignal = Sdk.CreateTracerProviderBuilder() + using var tracerProvider = Sdk.CreateTracerProviderBuilder() .AddProcessor(activityProcessor.Object) .AddHttpClientInstrumentation( c => c.Filter = (req) => !req.RequestUri.OriginalString.Contains(this.url)) @@ -238,7 +238,7 @@ public async Task RequestNotCollectedWhenInstrumentationFilterApplied() public async Task RequestNotCollectedWhenInstrumentationFilterThrowsException() { var activityProcessor = new Mock>(); - using var shutdownSignal = Sdk.CreateTracerProviderBuilder() + using var tracerProvider = Sdk.CreateTracerProviderBuilder() .AddProcessor(activityProcessor.Object) .AddHttpClientInstrumentation( c => c.Filter = (req) => throw new Exception("From Instrumentation filter")) @@ -256,7 +256,7 @@ public async Task RequestNotCollectedWhenInstrumentationFilterThrowsException() public void AddHttpClientInstrumentationUsesHttpWebRequestInstrumentationOptions() { var activityProcessor = new Mock>(); - using var tracerProviderSdk = Sdk.CreateTracerProviderBuilder() + using var tracerProvider = Sdk.CreateTracerProviderBuilder() .AddProcessor(activityProcessor.Object) .AddHttpClientInstrumentation(options => { @@ -273,7 +273,7 @@ public async Task HttpWebRequestInstrumentationOnExistingInstance() await client.GetAsync(this.url).ConfigureAwait(false); var activityProcessor = new Mock>(); - using var shutdownSignal = Sdk.CreateTracerProviderBuilder() + using var tracerProvider = Sdk.CreateTracerProviderBuilder() .AddProcessor(activityProcessor.Object) .AddHttpClientInstrumentation() .Build(); diff --git a/test/OpenTelemetry.Instrumentation.Http.Tests/HttpWebRequestTests.netfx.cs b/test/OpenTelemetry.Instrumentation.Http.Tests/HttpWebRequestTests.netfx.cs index 16faa12974c..14c3347da41 100644 --- a/test/OpenTelemetry.Instrumentation.Http.Tests/HttpWebRequestTests.netfx.cs +++ b/test/OpenTelemetry.Instrumentation.Http.Tests/HttpWebRequestTests.netfx.cs @@ -46,7 +46,7 @@ public void HttpOutCallsAreCollectedSuccessfully(HttpTestData.HttpOutTestCase tc out var port); var activityProcessor = new Mock>(); - using var shutdownSignal = Sdk.CreateTracerProviderBuilder() + using var tracerProvider = Sdk.CreateTracerProviderBuilder() .AddProcessor(activityProcessor.Object) .AddHttpClientInstrumentation(options => { diff --git a/test/OpenTelemetry.Instrumentation.SqlClient.Tests/SqlClientTests.cs b/test/OpenTelemetry.Instrumentation.SqlClient.Tests/SqlClientTests.cs index d4ab1966c2e..aa313d0717d 100644 --- a/test/OpenTelemetry.Instrumentation.SqlClient.Tests/SqlClientTests.cs +++ b/test/OpenTelemetry.Instrumentation.SqlClient.Tests/SqlClientTests.cs @@ -84,7 +84,7 @@ public void SuccessfulCommandTest( var activityProcessor = new Mock>(); activityProcessor.Setup(x => x.OnStart(It.IsAny())).Callback(c => c.SetTag("enriched", "no")); var sampler = new TestSampler(); - using var shutdownSignal = Sdk.CreateTracerProviderBuilder() + using var tracerProvider = Sdk.CreateTracerProviderBuilder() .AddProcessor(activityProcessor.Object) .SetSampler(sampler) .AddSqlClientInstrumentation(options => diff --git a/test/OpenTelemetry.Instrumentation.StackExchangeRedis.Tests/Implementation/RedisProfilerEntryToActivityConverterTests.cs b/test/OpenTelemetry.Instrumentation.StackExchangeRedis.Tests/Implementation/RedisProfilerEntryToActivityConverterTests.cs index a385124addb..373b8d66be0 100644 --- a/test/OpenTelemetry.Instrumentation.StackExchangeRedis.Tests/Implementation/RedisProfilerEntryToActivityConverterTests.cs +++ b/test/OpenTelemetry.Instrumentation.StackExchangeRedis.Tests/Implementation/RedisProfilerEntryToActivityConverterTests.cs @@ -30,7 +30,7 @@ namespace OpenTelemetry.Instrumentation.StackExchangeRedis.Implementation public class RedisProfilerEntryToActivityConverterTests : IDisposable { private readonly ConnectionMultiplexer connection; - private readonly IDisposable sdk; + private readonly IDisposable tracerProvider; public RedisProfilerEntryToActivityConverterTests() { @@ -42,14 +42,14 @@ public RedisProfilerEntryToActivityConverterTests() this.connection = ConnectionMultiplexer.Connect(connectionOptions); - this.sdk = Sdk.CreateTracerProviderBuilder() + this.tracerProvider = Sdk.CreateTracerProviderBuilder() .AddRedisInstrumentation(this.connection) .Build(); } public void Dispose() { - this.sdk.Dispose(); + this.tracerProvider.Dispose(); this.connection.Dispose(); } diff --git a/test/OpenTelemetry.Tests/Trace/ActivityExtensionsTest.cs b/test/OpenTelemetry.Tests/Trace/ActivityExtensionsTest.cs index a0590ebccd6..b67dc80333e 100644 --- a/test/OpenTelemetry.Tests/Trace/ActivityExtensionsTest.cs +++ b/test/OpenTelemetry.Tests/Trace/ActivityExtensionsTest.cs @@ -30,7 +30,7 @@ public class ActivityExtensionsTest [Fact] public void SetStatus() { - using var openTelemetrySdk = Sdk.CreateTracerProviderBuilder() + using var tracerProvider = Sdk.CreateTracerProviderBuilder() .AddSource(ActivitySourceName) .Build(); @@ -45,7 +45,7 @@ public void SetStatus() [Fact] public void SetStatusWithDescription() { - using var openTelemetrySdk = Sdk.CreateTracerProviderBuilder() + using var tracerProvider = Sdk.CreateTracerProviderBuilder() .AddSource(ActivitySourceName) .Build(); @@ -62,7 +62,7 @@ public void SetStatusWithDescription() [Fact] public void SetStatusWithDescriptionTwice() { - using var openTelemetrySdk = Sdk.CreateTracerProviderBuilder() + using var tracerProvider = Sdk.CreateTracerProviderBuilder() .AddSource(ActivitySourceName) .Build(); @@ -80,7 +80,7 @@ public void SetStatusWithDescriptionTwice() [Fact] public void SetStatusWithIgnoredDescription() { - using var openTelemetrySdk = Sdk.CreateTracerProviderBuilder() + using var tracerProvider = Sdk.CreateTracerProviderBuilder() .AddSource(ActivitySourceName) .Build(); @@ -97,7 +97,7 @@ public void SetStatusWithIgnoredDescription() [Fact] public void SetCancelledStatus() { - using var openTelemetrySdk = Sdk.CreateTracerProviderBuilder() + using var tracerProvider = Sdk.CreateTracerProviderBuilder() .AddSource(ActivitySourceName) .Build(); @@ -112,7 +112,7 @@ public void SetCancelledStatus() [Fact] public void GetStatusWithNoStatusInActivity() { - using var openTelemetrySdk = Sdk.CreateTracerProviderBuilder() + using var tracerProvider = Sdk.CreateTracerProviderBuilder() .AddSource(ActivitySourceName) .Build(); @@ -126,7 +126,7 @@ public void GetStatusWithNoStatusInActivity() [Fact] public void LastSetStatusWins() { - using var openTelemetrySdk = Sdk.CreateTracerProviderBuilder() + using var tracerProvider = Sdk.CreateTracerProviderBuilder() .AddSource(ActivitySourceName) .Build(); @@ -260,7 +260,7 @@ public void EnumerateLinksEmpty() [Fact] public void EnumerateLinksNonempty() { - using var openTelemetrySdk = Sdk.CreateTracerProviderBuilder() + using var tracerProvider = Sdk.CreateTracerProviderBuilder() .AddSource(ActivitySourceName) .Build(); diff --git a/test/OpenTelemetry.Tests/Trace/ExportProcessorTest.cs b/test/OpenTelemetry.Tests/Trace/ExportProcessorTest.cs index 77caab6158a..879e377edce 100644 --- a/test/OpenTelemetry.Tests/Trace/ExportProcessorTest.cs +++ b/test/OpenTelemetry.Tests/Trace/ExportProcessorTest.cs @@ -33,7 +33,7 @@ public void ExportProcessorIgnoresActivityWhenDropped() var exportedItems = new List(); var processor = new TestActivityExportProcessor(new InMemoryExporter(exportedItems)); using var activitySource = new ActivitySource(ActivitySourceName); - using var sdk = Sdk.CreateTracerProviderBuilder() + using var tracerProvider = Sdk.CreateTracerProviderBuilder() .AddSource(ActivitySourceName) .SetSampler(sampler) .AddProcessor(processor) @@ -55,7 +55,7 @@ public void ExportProcessorIgnoresActivityMarkedAsRecordOnly() var exportedItems = new List(); var processor = new TestActivityExportProcessor(new InMemoryExporter(exportedItems)); using var activitySource = new ActivitySource(ActivitySourceName); - using var sdk = Sdk.CreateTracerProviderBuilder() + using var tracerProvider = Sdk.CreateTracerProviderBuilder() .AddSource(ActivitySourceName) .SetSampler(sampler) .AddProcessor(processor) @@ -77,7 +77,7 @@ public void ExportProcessorExportsActivityMarkedAsRecordAndSample() var exportedItems = new List(); var processor = new TestActivityExportProcessor(new InMemoryExporter(exportedItems)); using var activitySource = new ActivitySource(ActivitySourceName); - using var sdk = Sdk.CreateTracerProviderBuilder() + using var tracerProvider = Sdk.CreateTracerProviderBuilder() .AddSource(ActivitySourceName) .SetSampler(sampler) .AddProcessor(processor) diff --git a/test/OpenTelemetry.Tests/Trace/TracerProviderSdkTest.cs b/test/OpenTelemetry.Tests/Trace/TracerProviderSdkTest.cs index 9f77a567e3b..e0debfd481b 100644 --- a/test/OpenTelemetry.Tests/Trace/TracerProviderSdkTest.cs +++ b/test/OpenTelemetry.Tests/Trace/TracerProviderSdkTest.cs @@ -39,7 +39,7 @@ public void TracerProviderSdkInvokesSamplingWithCorrectParameters() { var testSampler = new TestSampler(); using var activitySource = new ActivitySource(ActivitySourceName); - using var sdk = Sdk.CreateTracerProviderBuilder() + using var tracerProvider = Sdk.CreateTracerProviderBuilder() .AddSource(ActivitySourceName) .SetSampler(testSampler) .Build(); @@ -123,7 +123,7 @@ public void TracerProviderSdkSamplerAttributesAreAppliedToActivity(SamplingDecis }; using var activitySource = new ActivitySource(ActivitySourceName); - using var sdk = Sdk.CreateTracerProviderBuilder() + using var tracerProvider = Sdk.CreateTracerProviderBuilder() .AddSource(ActivitySourceName) .SetSampler(testSampler) .Build(); @@ -144,7 +144,7 @@ public void TracerSdkSetsActivitySamplingResultBasedOnSamplingDecision() { var testSampler = new TestSampler(); using var activitySource = new ActivitySource(ActivitySourceName); - using var sdk = Sdk.CreateTracerProviderBuilder() + using var tracerProvider = Sdk.CreateTracerProviderBuilder() .AddSource(ActivitySourceName) .SetSampler(testSampler) .Build(); @@ -204,7 +204,7 @@ public void TracerSdkSetsActivitySamplingResultToNoneWhenSuppressInstrumentation var testSampler = new TestSampler(); using var activitySource = new ActivitySource(ActivitySourceName); - using var sdk = Sdk.CreateTracerProviderBuilder() + using var tracerProvider = Sdk.CreateTracerProviderBuilder() .AddSource(ActivitySourceName) .SetSampler(testSampler) .Build(); diff --git a/test/OpenTelemetry.Tests/Trace/TracerTest.cs b/test/OpenTelemetry.Tests/Trace/TracerTest.cs index ae37588ff89..5df66f9138d 100644 --- a/test/OpenTelemetry.Tests/Trace/TracerTest.cs +++ b/test/OpenTelemetry.Tests/Trace/TracerTest.cs @@ -60,7 +60,7 @@ public void TracerStartReturnsNoopSpanWhenNoSdk() [Fact] public void Tracer_StartRootSpan_BadArgs_NullSpanName() { - using var openTelemetry = Sdk.CreateTracerProviderBuilder() + using var tracerProvider = Sdk.CreateTracerProviderBuilder() .AddSource("tracername") .Build(); @@ -77,7 +77,7 @@ public void Tracer_StartRootSpan_BadArgs_NullSpanName() [Fact] public void Tracer_StartSpan_BadArgs_NullSpanName() { - using var openTelemetry = Sdk.CreateTracerProviderBuilder() + using var tracerProvider = Sdk.CreateTracerProviderBuilder() .AddSource("tracername") .Build(); @@ -94,7 +94,7 @@ public void Tracer_StartSpan_BadArgs_NullSpanName() [Fact] public void Tracer_StartActiveSpan_BadArgs_NullSpanName() { - using var openTelemetry = Sdk.CreateTracerProviderBuilder() + using var tracerProvider = Sdk.CreateTracerProviderBuilder() .AddSource("tracername") .Build(); @@ -111,7 +111,7 @@ public void Tracer_StartActiveSpan_BadArgs_NullSpanName() [Fact] public void Tracer_StartSpan_FromParent_BadArgs_NullSpanName() { - using var openTelemetry = Sdk.CreateTracerProviderBuilder() + using var tracerProvider = Sdk.CreateTracerProviderBuilder() .AddSource("tracername") .Build(); @@ -125,7 +125,7 @@ public void Tracer_StartSpan_FromParent_BadArgs_NullSpanName() [Fact] public void Tracer_StartSpan_FromParentContext_BadArgs_NullSpanName() { - using var openTelemetry = Sdk.CreateTracerProviderBuilder() + using var tracerProvider = Sdk.CreateTracerProviderBuilder() .AddSource("tracername") .Build(); @@ -141,7 +141,7 @@ public void Tracer_StartSpan_FromParentContext_BadArgs_NullSpanName() [Fact] public void Tracer_StartActiveSpan_FromParent_BadArgs_NullSpanName() { - using var openTelemetry = Sdk.CreateTracerProviderBuilder() + using var tracerProvider = Sdk.CreateTracerProviderBuilder() .AddSource("tracername") .Build(); @@ -155,7 +155,7 @@ public void Tracer_StartActiveSpan_FromParent_BadArgs_NullSpanName() [Fact] public void Tracer_StartActiveSpan_FromParentContext_BadArgs_NullSpanName() { - using var openTelemetry = Sdk.CreateTracerProviderBuilder() + using var tracerProvider = Sdk.CreateTracerProviderBuilder() .AddSource("tracername") .Build(); @@ -171,7 +171,7 @@ public void Tracer_StartActiveSpan_FromParentContext_BadArgs_NullSpanName() [Fact] public void Tracer_StartActiveSpan_CreatesActiveSpan() { - using var openTelemetry = Sdk.CreateTracerProviderBuilder() + using var tracerProvider = Sdk.CreateTracerProviderBuilder() .AddSource("tracername") .Build(); @@ -195,7 +195,7 @@ public void Tracer_StartActiveSpan_CreatesActiveSpan() [Fact] public void GetCurrentSpanBlank() { - using var openTelemetry = Sdk.CreateTracerProviderBuilder() + using var tracerProvider = Sdk.CreateTracerProviderBuilder() .AddSource("tracername") .Build(); Assert.False(Tracer.CurrentSpan.Context.IsValid); @@ -204,7 +204,7 @@ public void GetCurrentSpanBlank() [Fact] public void GetCurrentSpanBlankWontThrowOnEnd() { - using var openTelemetry = Sdk.CreateTracerProviderBuilder() + using var tracerProvider = Sdk.CreateTracerProviderBuilder() .AddSource("tracername") .Build(); var current = Tracer.CurrentSpan; @@ -214,7 +214,7 @@ public void GetCurrentSpanBlankWontThrowOnEnd() [Fact] public void GetCurrentSpan() { - using var openTelemetry = Sdk.CreateTracerProviderBuilder() + using var tracerProvider = Sdk.CreateTracerProviderBuilder() .AddSource("tracername") .Build(); @@ -228,7 +228,7 @@ public void GetCurrentSpan() [Fact] public void CreateSpan_Sampled() { - using var openTelemetry = Sdk.CreateTracerProviderBuilder() + using var tracerProvider = Sdk.CreateTracerProviderBuilder() .AddSource("tracername") .Build(); var span = this.tracer.StartSpan("foo"); @@ -238,7 +238,7 @@ public void CreateSpan_Sampled() [Fact] public void CreateSpan_NotSampled() { - using var openTelemetry = Sdk.CreateTracerProviderBuilder() + using var tracerProvider = Sdk.CreateTracerProviderBuilder() .AddSource("tracername") .SetSampler(new AlwaysOffSampler()) .Build();