public AgentWriter(IApi api, IDogStatsd statsd, bool automaticFlush = true, int queueSize = 1000) { _tracesBuffer = new AgentWriterBuffer <Span[]>(queueSize); _api = api; _statsd = statsd; _flushTask = automaticFlush ? Task.Run(FlushTracesTaskLoopAsync) : Task.FromResult(true); }