Skip to content

Commit

Permalink
Merge pull request #8 from Tianlin-Zhao/origin/propagators
Browse files Browse the repository at this point in the history
Origin/propagators
  • Loading branch information
Tianlin-Zhao authored Jul 29, 2020
2 parents d6be256 + cd057c4 commit 60d95a7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 4 additions & 2 deletions api/include/opentelemetry/trace/default_span.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,10 @@ class DefaultSpan: public Span {
DefaultSpan(DefaultSpan&& spn) : span_context_(spn.GetContext()) {}
DefaultSpan(const DefaultSpan& spn) : span_context_(spn.GetContext()) {}

trace::Tracer &tracer() noexcept {
return tracer_; // Invalid tracer
// This is an invalid implementation
trace::Tracer &tracer() const noexcept {
trace::Tracer tracer = trace::Tracer();
return tracer; // Invalid tracer
}

// Creates an instance of this class with spancontext.
Expand Down
3 changes: 2 additions & 1 deletion api/include/opentelemetry/trace/span.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include "opentelemetry/common/attribute_value.h"
#include "opentelemetry/core/timestamp.h"
#include "opentelemetry/nostd/span.h"
#include "opentelemetry/trace/span_context.h"
#include "opentelemetry/nostd/string_view.h"
#include "opentelemetry/trace/canonical_code.h"
#include "opentelemetry/trace/key_value_iterable_view.h"
Expand Down Expand Up @@ -153,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 60d95a7

Please sign in to comment.