Example #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ZipkinTraceExporter"/> class.
 /// </summary>
 /// <param name="options">Configuration options.</param>
 /// <param name="client">Http client to use to upload telemetry.</param>
 public ZipkinTraceExporter(ZipkinTraceExporterOptions options, HttpClient client = null)
 {
     this.options         = options;
     this.localEndpoint   = this.GetLocalZipkinEndpoint();
     this.httpClient      = client ?? new HttpClient();
     this.serviceEndpoint = options.Endpoint?.ToString();
 }
        /// <summary>
        /// Initializes a new instance of the <see cref="ZipkinTraceExporter"/> class.
        /// This exporter sends OpenTelemetry spans to Zipkin.
        /// </summary>
        /// <param name="options">Zipkin exporter configuration options.</param>
        /// <param name="exporter">Exporter to get traces from.</param>
        /// <param name="client">Http client to use to upload telemetry.
        /// For local development with invalid certificates use code like this:
        /// new HttpClient(new HttpClientHandler() { ServerCertificateCustomValidationCallback = HttpClientHandler.DangerousAcceptAnyServerCertificateValidator }).
        /// </param>
        public ZipkinTraceExporter(ZipkinTraceExporterOptions options, ISpanExporter exporter, HttpClient client = null)
        {
            this.options = options;

            this.exporter = exporter;

            this.httpClient = client;
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="ZipkinTraceExporter"/> class.
        /// This exporter sends Open Census traces to Zipkin.
        /// </summary>
        /// <param name="options">Zipkin exporter configuration options.</param>
        /// <param name="exportComponent">Exporter to get traces from.</param>
        /// <param name="client">Http client to use to upload telemetry.
        /// For local development with invalid certificates use code like this:
        /// new HttpClient(new HttpClientHandler() { ServerCertificateCustomValidationCallback = HttpClientHandler.DangerousAcceptAnyServerCertificateValidator }).
        /// </param>
        public ZipkinTraceExporter(ZipkinTraceExporterOptions options, IExportComponent exportComponent, HttpClient client = null)
        {
            this.options = options;

            this.exportComponent = exportComponent;

            this.httpClient = client;
        }
Example #4
0
        public static TracerBuilder UseZipkin(this TracerBuilder builder, Action <ZipkinTraceExporterOptions> configure)
        {
            if (builder == null)
            {
                throw new ArgumentNullException(nameof(builder));
            }

            if (configure == null)
            {
                throw new ArgumentNullException(nameof(configure));
            }

            var options = new ZipkinTraceExporterOptions();

            configure(options);
            return(builder.SetExporter(new ZipkinTraceExporter(options)));
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="ZipkinTraceExporter"/> class.
 /// </summary>
 /// <param name="options">Configuration options.</param>
 /// <param name="client">Http client to use to upload telemetry.</param>
 public ZipkinTraceExporter(ZipkinTraceExporterOptions options, HttpClient client = null)
 {
     this.options       = options;
     this.LocalEndpoint = this.GetLocalZipkinEndpoint();
     this.httpClient    = client ?? new HttpClient();
 }