Skip to content

Commit

Permalink
add externally accessible flush function (#72)
Browse files Browse the repository at this point in the history
  • Loading branch information
stevencl1013 committed Jul 27, 2020
1 parent ce9a184 commit 7f25d82
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions exporter/trace/cloudtrace.go
Expand Up @@ -300,6 +300,14 @@ func (e *Exporter) ExportSpan(ctx context.Context, sd *export.SpanData) {
e.traceExporter.ExportSpan(ctx, sd)
}

// Flush waits for exported data to be uploaded.
//
// This is useful if your program is ending and you do not
// want to lose recent spans.
func (e *Exporter) Flush() {
e.traceExporter.Flush()
}

func (e *Exporter) sdWithDefaultTraceAttributes(sd *export.SpanData) *export.SpanData {
newSD := *sd
for k, v := range e.traceExporter.o.DefaultTraceAttributes {
Expand Down

0 comments on commit 7f25d82

Please sign in to comment.