public void WriteTrace(Span[] trace)
        {
            var success = _tracesBuffer.Push(trace);

            if (!success)
            {
                Log.Warning("Trace buffer is full. Dropping a trace from the buffer.");
            }

            _metrics.Increment(TracerMetricNames.Queue.EnqueuedTraces);
            _metrics.Increment(TracerMetricNames.Queue.EnqueuedSpans, trace.Length);

            if (!success)
            {
                _metrics.Increment(TracerMetricNames.Queue.DroppedTraces);
                _metrics.Increment(TracerMetricNames.Queue.DroppedSpans, trace.Length);
            }
        }
        public void WriteTrace(ArraySegment <Span> trace)
        {
            // TODO: Simple solution when pulling from upstream: copy the segment contents
            // to an array. Review this code and optimize as appropriate.
            var success = _tracesBuffer.Push(trace.ToArray());

            if (!success)
            {
                Log.Warning("Trace buffer is full. Dropping a trace from the buffer.");
            }

            _metrics.Increment(TracerMetricNames.Queue.EnqueuedTraces);
            _metrics.Increment(TracerMetricNames.Queue.EnqueuedSpans, trace.Count);

            if (!success)
            {
                _metrics.Increment(TracerMetricNames.Queue.DroppedTraces);
                _metrics.Increment(TracerMetricNames.Queue.DroppedSpans, trace.Count);
            }
        }