Fix flushing
@@ -789,14 +789,14 @@ func flushSpansDatadog(ctx context.Context, s *Server, nilTracer opentracing.Tra
}
func flushSpansLightstep(ctx context.Context, s *Server, lightstepTracer opentracing.Tracer, ssfSpans []ssf.SSFSpan) {
- defer lightstep.CloseTracer(lightstepTracer)
-
span, _ := trace.StartSpanFromContext(ctx, "")
defer span.Finish()
for _, ssfSpan := range ssfSpans {
flushSpanLightstep(lightstepTracer, ssfSpan)
}
+ lightstep.FlushLightStepTracer(lightstepTracer)
+
// Confusingly, this will still get called even if the Opentracing client fails to reach the collector
// because we don't get access to the error if that happens.
log.WithField("traces", len(ssfSpans)).Info("Completed flushing traces to Lightstep")
