Skip to content
Open
Show file tree
Hide file tree
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
7 changes: 7 additions & 0 deletions src/tracer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,13 @@ Tracer::Tracer(TracerOptions options, std::shared_ptr<Writer> writer,
options.service, traceTagsPropagationMaxLength(options, *logger_)});
}

Tracer::~Tracer() {
try {
Close();
} catch (...) {
}
}

std::unique_ptr<ot::Span> Tracer::StartSpanWithOptions(ot::string_view operation_name,
const ot::StartSpanOptions &options) const
noexcept try {
Expand Down
3 changes: 3 additions & 0 deletions src/tracer.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ class Tracer : public ot::Tracer, public std::enable_shared_from_this<Tracer> {

Tracer() = delete;

// Destructs tracer and flushes internal buffers
virtual ~Tracer();

// Starts a new span.
std::unique_ptr<ot::Span> StartSpanWithOptions(ot::string_view operation_name,
const ot::StartSpanOptions &options) const
Expand Down