Skip to content

Commit

Permalink
tracer workaround
Browse files Browse the repository at this point in the history
  • Loading branch information
Tianlin-Zhao committed Jul 29, 2020
1 parent 5700e4b commit df52301
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion api/include/opentelemetry/trace/default_span.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ class DefaultSpan: public Span {
DefaultSpan(DefaultSpan&& spn) : span_context_(spn.GetContext()) {}
DefaultSpan(const DefaultSpan& spn) : span_context_(spn.GetContext()) {}

trace::Tracer &tracer() noexcept {
trace::Tracer &tracer() const noexcept {
trace::Tracer trace = trace::Tracer();
return tracer_; // Invalid tracer
}

Expand Down
2 changes: 1 addition & 1 deletion api/include/opentelemetry/trace/span.h
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ class Span
// AddEvent).
virtual bool IsRecording() const noexcept = 0;

virtual trace::Tracer &tracer() noexcept = 0;
virtual trace::Tracer &tracer() const noexcept = 0;
};
} // namespace trace
OPENTELEMETRY_END_NAMESPACE

0 comments on commit df52301

Please sign in to comment.