Skip to content
This repository has been archived by the owner on Jul 1, 2022. It is now read-only.

Close tracer on JVM shutdown #546

Merged
merged 1 commit into from
Sep 7, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,14 @@ protected JaegerTracer(JaegerTracer.Builder builder) {
}
this.ipv4 = ipv4;
this.tags = Collections.unmodifiableMap(tags);

// register this tracer with a shutdown hook, to flush the spans before the VM shuts down
Runtime.getRuntime().addShutdownHook(new Thread() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what will this do to unit tests?

@Override
public void run() {
JaegerTracer.this.close();
}
});
}

public String getVersion() {
Expand Down