We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b890969 commit 61bea77Copy full SHA for 61bea77
api/include/opentelemetry/trace/context.h
@@ -20,7 +20,10 @@ inline nostd::shared_ptr<Span> GetSpan(const context::Context &context) noexcept
20
{
21
return nostd::get<nostd::shared_ptr<Span>>(span);
22
}
23
- return nostd::shared_ptr<Span>(new DefaultSpan(SpanContext::GetInvalid()));
+
24
+ static thread_local nostd::shared_ptr<Span> invalid_span =
25
+ nostd::shared_ptr<Span>(new DefaultSpan(SpanContext::GetInvalid()));
26
+ return invalid_span;
27
28
29
inline bool IsRootSpan(const context::Context &context) noexcept
0 commit comments