/// <summary> /// Start exporter. /// </summary> public void Start() { lock (this.lck) { this.tokenSource = new CancellationTokenSource(); var token = this.tokenSource.Token; var metricsExporter = new MetricsExporterThread(this.telemetryConfiguration, this.viewManager, token, TimeSpan.FromMinutes(1)); this.workerThread = Task.Factory.StartNew((Action)metricsExporter.WorkerThread, TaskCreationOptions.LongRunning); } }
/// <summary> /// Start exporter. /// </summary> public void Start() { lock (this.lck) { if (this.handler != null) { return; } this.handler = new TraceExporterHandler(this.telemetryConfiguration); this.exportComponent.SpanExporter.RegisterHandler(TraceExporterName, this.handler); this.tokenSource = new CancellationTokenSource(); CancellationToken token = this.tokenSource.Token; var metricsExporter = new MetricsExporterThread(this.telemetryConfiguration, this.viewManager, token, TimeSpan.FromMinutes(1)); this.workerThread = Task.Factory.StartNew((Action)metricsExporter.WorkerThread, TaskCreationOptions.LongRunning); } }