From 94834dd74d1781d68d756e36c182c31965f2f4be Mon Sep 17 00:00:00 2001 From: TianlinZhao Date: Fri, 31 Jul 2020 22:38:51 -0400 Subject: [PATCH] tracer --- api/include/opentelemetry/plugin/tracer.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/api/include/opentelemetry/plugin/tracer.h b/api/include/opentelemetry/plugin/tracer.h index b0223e639a..6408bdb478 100644 --- a/api/include/opentelemetry/plugin/tracer.h +++ b/api/include/opentelemetry/plugin/tracer.h @@ -48,6 +48,8 @@ class Span final : public trace::Span bool IsRecording() const noexcept override { return span_->IsRecording(); } + trace::SpanContext GetContext() { return span_->GetContext(); } + private: std::shared_ptr tracer_; std::unique_ptr span_; @@ -72,8 +74,8 @@ class Tracer final : public trace::Tracer, public std::enable_shared_from_this{new (std::nothrow) - Span{this->shared_from_this(), std::move(span)}}; + trace::Span* spn = new (std::nothrow)Span{this->shared_from_this(), std::move(span)}; + return nostd::unique_ptr{spn}; } void ForceFlushWithMicroseconds(uint64_t timeout) noexcept override