Track the capacity/fill grade of the SpanChan at flush time
This should give us an idea of how much capacity is consumed during
spikes, and what number it should be.
@@ -27,7 +27,10 @@ func (s *Server) Flush(ctx context.Context) {
span.Add(ssf.Gauge("mem.heap_alloc_bytes", float32(mem.HeapAlloc), nil),
ssf.Gauge("gc.number", float32(mem.NumGC), nil),
- ssf.Gauge("gc.pause_total_ns", float32(mem.PauseTotalNs), nil))
+ ssf.Gauge("gc.pause_total_ns", float32(mem.PauseTotalNs), nil),
+ ssf.Gauge("worker.span_chan.total_elements", float32(len(s.SpanChan)), nil),
+ ssf.Gauge("worker.span_chan.total_capacity", float32(cap(s.SpanChan)), nil),
+ )
// TODO Why is this not in the worker the way the trace worker is set up?
events, checks := s.EventWorker.Flush()
