From d7e1c67b9028658db211ed068f5443f6dbe23d21 Mon Sep 17 00:00:00 2001 From: Sergey Kanzhelev Date: Sun, 27 Oct 2019 23:08:06 -0700 Subject: [PATCH 1/3] more docs --- .../ApplicationInsightsTraceExporter.cs | 10 ++++++++++ ...Telemetry.Exporter.ApplicationInsights.csproj | 3 --- .../TracerBuilderExtensions.cs | 16 ++++++++++++++++ .../OpenTelemetry.Exporter.Stackdriver.csproj | 3 --- .../StackdriverTraceExporter.cs | 6 ++++++ .../OpenTelemetry.Exporter.Zipkin.csproj | 4 ---- .../TracerBuilderExtensions.cs | 16 ++++++++++++++++ .../ZipkinTraceExporter.cs | 10 ++++++++++ 8 files changed, 58 insertions(+), 10 deletions(-) diff --git a/src/OpenTelemetry.Exporter.ApplicationInsights/ApplicationInsightsTraceExporter.cs b/src/OpenTelemetry.Exporter.ApplicationInsights/ApplicationInsightsTraceExporter.cs index 05184062f1e..777d11c55c1 100644 --- a/src/OpenTelemetry.Exporter.ApplicationInsights/ApplicationInsightsTraceExporter.cs +++ b/src/OpenTelemetry.Exporter.ApplicationInsights/ApplicationInsightsTraceExporter.cs @@ -30,11 +30,18 @@ namespace OpenTelemetry.Exporter.ApplicationInsights { + /// + /// Applicaiton Insights trace exporter. + /// public class ApplicationInsightsTraceExporter : SpanExporter, IDisposable { private readonly TelemetryClient telemetryClient; private readonly string serviceEndpoint; + /// + /// Initializes a new instance of the class. + /// + /// Telemetry configuration to use. public ApplicationInsightsTraceExporter(TelemetryConfiguration telemetryConfiguration) { this.telemetryClient = new TelemetryClient(telemetryConfiguration); @@ -42,6 +49,7 @@ public ApplicationInsightsTraceExporter(TelemetryConfiguration telemetryConfigur this.serviceEndpoint = telemetryConfiguration.TelemetryChannel.EndpointAddress; } + /// public override Task ExportAsync(IEnumerable spanDataList, CancellationToken cancellationToken) { foreach (var span in spanDataList) @@ -289,6 +297,7 @@ public override Task ExportAsync(IEnumerable spanDataList, C return Task.FromResult(ExportResult.Success); } + /// public override Task ShutdownAsync(CancellationToken cancellationToken) { // TODO cancellation support @@ -296,6 +305,7 @@ public override Task ShutdownAsync(CancellationToken cancellationToken) return Task.CompletedTask; } + /// public void Dispose() { this.ShutdownAsync(CancellationToken.None).ContinueWith(_ => { }).Wait(); diff --git a/src/OpenTelemetry.Exporter.ApplicationInsights/OpenTelemetry.Exporter.ApplicationInsights.csproj b/src/OpenTelemetry.Exporter.ApplicationInsights/OpenTelemetry.Exporter.ApplicationInsights.csproj index e04fe821583..3f392b8e87f 100644 --- a/src/OpenTelemetry.Exporter.ApplicationInsights/OpenTelemetry.Exporter.ApplicationInsights.csproj +++ b/src/OpenTelemetry.Exporter.ApplicationInsights/OpenTelemetry.Exporter.ApplicationInsights.csproj @@ -4,9 +4,6 @@ Application Insights exporter for Open Telemetry. $(PackageTags);application-insights;azure;distributed-tracing - - $(NoWarn),1591 - diff --git a/src/OpenTelemetry.Exporter.ApplicationInsights/TracerBuilderExtensions.cs b/src/OpenTelemetry.Exporter.ApplicationInsights/TracerBuilderExtensions.cs index 7045284169e..d6d4333ad44 100644 --- a/src/OpenTelemetry.Exporter.ApplicationInsights/TracerBuilderExtensions.cs +++ b/src/OpenTelemetry.Exporter.ApplicationInsights/TracerBuilderExtensions.cs @@ -21,8 +21,17 @@ namespace OpenTelemetry.Trace.Configuration { + /// + /// Extension methods to simplify registering of Application Insights exporter. + /// public static class TracerBuilderExtensions { + /// + /// Enables Application Insights exporter. + /// + /// Trace builder to use. + /// Configuration options. + /// The instance of to chain the calls. public static TracerBuilder UseApplicationInsights(this TracerBuilder builder, Action configure) { if (builder == null) @@ -42,6 +51,13 @@ public static TracerBuilder UseApplicationInsights(this TracerBuilder builder, A .SetExportingProcessor(e => new BatchingSpanProcessor(e))); } + /// + /// Enables Application Insights exporter. + /// + /// Trace builder to use. + /// Configuration options. + /// Span processor configuraiton. + /// The instance of to chain the calls. public static TracerBuilder UseApplicationInsights(this TracerBuilder builder, Action applicationInsightsConfigure, Action< SpanProcessorPipelineBuilder> processorConfigure) { diff --git a/src/OpenTelemetry.Exporter.Stackdriver/OpenTelemetry.Exporter.Stackdriver.csproj b/src/OpenTelemetry.Exporter.Stackdriver/OpenTelemetry.Exporter.Stackdriver.csproj index 761ac7aeb6b..c9d7cf978ca 100644 --- a/src/OpenTelemetry.Exporter.Stackdriver/OpenTelemetry.Exporter.Stackdriver.csproj +++ b/src/OpenTelemetry.Exporter.Stackdriver/OpenTelemetry.Exporter.Stackdriver.csproj @@ -5,9 +5,6 @@ True $(PackageTags);Stackdriver;Google;GCP;distributed-tracing - - $(NoWarn),1591 - $([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), 'OpenTelemetry.sln'))/build/OpenTelemetry.prod.loose.ruleset diff --git a/src/OpenTelemetry.Exporter.Stackdriver/StackdriverTraceExporter.cs b/src/OpenTelemetry.Exporter.Stackdriver/StackdriverTraceExporter.cs index cabebcbef92..d3e8bbd1299 100644 --- a/src/OpenTelemetry.Exporter.Stackdriver/StackdriverTraceExporter.cs +++ b/src/OpenTelemetry.Exporter.Stackdriver/StackdriverTraceExporter.cs @@ -60,6 +60,10 @@ static StackdriverTraceExporter() } } + /// + /// Initializes a new instance of class. + /// + /// Project ID to send telemetry to. public StackdriverTraceExporter(string projectId) { this.googleCloudProjectId = new Google.Api.Gax.ResourceNames.ProjectName(projectId); @@ -71,6 +75,7 @@ public StackdriverTraceExporter(string projectId) this.traceServiceSettings.CallSettings = callSettings; } + /// public override async Task ExportAsync(IEnumerable spanDataList, CancellationToken cancellationToken) { var traceWriter = TraceServiceClient.Create(settings: this.traceServiceSettings); @@ -89,6 +94,7 @@ public override async Task ExportAsync(IEnumerable spa return ExportResult.Success; } + /// public override Task ShutdownAsync(CancellationToken cancellationToken) { return Task.CompletedTask; diff --git a/src/OpenTelemetry.Exporter.Zipkin/OpenTelemetry.Exporter.Zipkin.csproj b/src/OpenTelemetry.Exporter.Zipkin/OpenTelemetry.Exporter.Zipkin.csproj index f32673cd468..906ca8be210 100644 --- a/src/OpenTelemetry.Exporter.Zipkin/OpenTelemetry.Exporter.Zipkin.csproj +++ b/src/OpenTelemetry.Exporter.Zipkin/OpenTelemetry.Exporter.Zipkin.csproj @@ -5,10 +5,6 @@ $(PackageTags);Zipkin;distributed-tracing - - $(NoWarn),1591 - - diff --git a/src/OpenTelemetry.Exporter.Zipkin/TracerBuilderExtensions.cs b/src/OpenTelemetry.Exporter.Zipkin/TracerBuilderExtensions.cs index 541e792aca2..bd6bceabcc8 100644 --- a/src/OpenTelemetry.Exporter.Zipkin/TracerBuilderExtensions.cs +++ b/src/OpenTelemetry.Exporter.Zipkin/TracerBuilderExtensions.cs @@ -20,8 +20,17 @@ namespace OpenTelemetry.Trace.Configuration { + /// + /// Extension methods to simplify registering of Zipkin exporter. + /// public static class TracerBuilderExtensions { + /// + /// Registers Zipkin exporter. + /// + /// Trace builder to use. + /// Configuration options. + /// The instance of to chain the calls. public static TracerBuilder UseZipkin(this TracerBuilder builder, Action configure) { if (builder == null) @@ -41,6 +50,13 @@ public static TracerBuilder UseZipkin(this TracerBuilder builder, Action new BatchingSpanProcessor(e))); } + /// + /// Registers Zipkin exporter. + /// + /// Trace builder to use. + /// Configuration options. + /// Span processor configuraiton. + /// The instance of to chain the calls. public static TracerBuilder UseZipkin(this TracerBuilder builder, Action zipkinConfigure, Action< SpanProcessorPipelineBuilder> processorConfigure) { diff --git a/src/OpenTelemetry.Exporter.Zipkin/ZipkinTraceExporter.cs b/src/OpenTelemetry.Exporter.Zipkin/ZipkinTraceExporter.cs index 8ab93108297..65e2860c0b3 100644 --- a/src/OpenTelemetry.Exporter.Zipkin/ZipkinTraceExporter.cs +++ b/src/OpenTelemetry.Exporter.Zipkin/ZipkinTraceExporter.cs @@ -29,6 +29,9 @@ namespace OpenTelemetry.Exporter.Zipkin { + /// + /// Zipkin exporter. + /// public class ZipkinTraceExporter : SpanExporter { private const long MillisPerSecond = 1000L; @@ -43,6 +46,11 @@ public class ZipkinTraceExporter : SpanExporter private readonly HttpClient httpClient; private readonly string serviceEndpoint; + /// + /// Initializes a new instance of the class. + /// + /// Configuration options. + /// Http client to use to upload telemetry. public ZipkinTraceExporter(ZipkinTraceExporterOptions options, HttpClient client = null) { this.options = options; @@ -51,6 +59,7 @@ public ZipkinTraceExporter(ZipkinTraceExporterOptions options, HttpClient client this.serviceEndpoint = options.Endpoint?.ToString(); } + /// public override async Task ExportAsync(IEnumerable otelSpanList, CancellationToken cancellationToken) { var zipkinSpans = new List(); @@ -96,6 +105,7 @@ public override async Task ExportAsync(IEnumerable otelSpanL } } + /// public override Task ShutdownAsync(CancellationToken cancellationToken) { return Task.CompletedTask; From 73991ce0f26389f90868ad408bc904310c47633e Mon Sep 17 00:00:00 2001 From: Sergey Kanzhelev Date: Mon, 28 Oct 2019 16:20:07 -0700 Subject: [PATCH 2/3] Update src/OpenTelemetry.Exporter.Zipkin/TracerBuilderExtensions.cs Co-Authored-By: Liudmila Molkova --- src/OpenTelemetry.Exporter.Zipkin/TracerBuilderExtensions.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/OpenTelemetry.Exporter.Zipkin/TracerBuilderExtensions.cs b/src/OpenTelemetry.Exporter.Zipkin/TracerBuilderExtensions.cs index bd6bceabcc8..052921e543a 100644 --- a/src/OpenTelemetry.Exporter.Zipkin/TracerBuilderExtensions.cs +++ b/src/OpenTelemetry.Exporter.Zipkin/TracerBuilderExtensions.cs @@ -55,7 +55,7 @@ public static TracerBuilder UseZipkin(this TracerBuilder builder, Action /// Trace builder to use. /// Configuration options. - /// Span processor configuraiton. + /// Span processor configuration. /// The instance of to chain the calls. public static TracerBuilder UseZipkin(this TracerBuilder builder, Action zipkinConfigure, Action< SpanProcessorPipelineBuilder> processorConfigure) From 4b85e65146c637850cbb5831acea4ed351d5ee58 Mon Sep 17 00:00:00 2001 From: Sergey Kanzhelev Date: Mon, 28 Oct 2019 16:20:14 -0700 Subject: [PATCH 3/3] Update src/OpenTelemetry.Exporter.ApplicationInsights/TracerBuilderExtensions.cs Co-Authored-By: Liudmila Molkova --- .../TracerBuilderExtensions.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/OpenTelemetry.Exporter.ApplicationInsights/TracerBuilderExtensions.cs b/src/OpenTelemetry.Exporter.ApplicationInsights/TracerBuilderExtensions.cs index d6d4333ad44..996fbcc6c55 100644 --- a/src/OpenTelemetry.Exporter.ApplicationInsights/TracerBuilderExtensions.cs +++ b/src/OpenTelemetry.Exporter.ApplicationInsights/TracerBuilderExtensions.cs @@ -56,7 +56,7 @@ public static TracerBuilder UseApplicationInsights(this TracerBuilder builder, A /// /// Trace builder to use. /// Configuration options. - /// Span processor configuraiton. + /// Span processor configuration. /// The instance of to chain the calls. public static TracerBuilder UseApplicationInsights(this TracerBuilder builder, Action applicationInsightsConfigure, Action< SpanProcessorPipelineBuilder> processorConfigure)