Skip to content

Commit

Permalink
Merge pull request #206 from stripe/cory-flush-ls-tracer
Browse files Browse the repository at this point in the history
Flush the LS tracer, since Close() doesn't seem to.
  • Loading branch information
cory-stripe authored Jul 18, 2017
2 parents 973425e + 6935965 commit fa157ec
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# 1.5.1, PENDING
# 1.5.1, 2017-07-18

## Bugfixes
* Flush the lightstep tracer before closing it. Thanks [gphat](https://github.com/gphat) with assist from [stangles](https://github.com/joshu-stripe)!

## Improvements
* Better document how to configure Veneur as a DogStatsD replacement. Thanks [gphat](https://github.com/gphat) with assist from [stangles](https://github.com/stangles)!
Expand Down
3 changes: 3 additions & 0 deletions flusher.go
Original file line number Diff line number Diff line change
Expand Up @@ -512,11 +512,13 @@ func (s *Server) flushTraces(ctx context.Context) {
})

for _, sink := range s.tracerSinks {
sinkFlushStart := time.Now()
sink.flush(span.Attach(ctx), s, sink.tracerThunk, ssfSpans)
tags := []string{
fmt.Sprintf("sink:%s", sink.name),
fmt.Sprintf("service:%s", trace.Service),
}
s.Statsd.TimeInMilliseconds("worker.trace.sink.flush_duration_ns", float64(time.Since(sinkFlushStart).Nanoseconds()), []string{fmt.Sprintf("sink:%s", sink.name)}, 1.0)

s.Statsd.Count("worker.trace.sink.flushed_total", int64(len(ssfSpans)), tags, 1)
}
Expand Down Expand Up @@ -784,6 +786,7 @@ func flushSpansLightstep(ctx context.Context, s *Server, tracerThunk func() open
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.
Expand Down

0 comments on commit fa157ec

Please sign in to comment.