@@ -26,7 +26,7 @@ namespace trace_api = opentelemetry::trace;
26
26
27
27
/* SpanContext contains the state that must propagate to child Spans and across
28
28
* process boundaries. It contains the identifiers TraceId and SpanId,
29
- * TraceFlags, TraceState, and whether it has a remote parent.
29
+ * TraceFlags, TraceState, and whether it was propagated from a remote parent.
30
30
*
31
31
* TODO: This is currently a placeholder class and requires revisiting
32
32
*/
@@ -38,14 +38,14 @@ class SpanContext final
38
38
*
39
39
* @param sampled_flag a required parameter specifying if child spans should be
40
40
* sampled
41
- * @param has_remote_parent a required parameter specifying if this context has
42
- * a remote parent
41
+ * @param is_remote true if this context was propagated from a remote parent.
43
42
*/
44
- SpanContext (bool sampled_flag, bool has_remote_parent )
43
+ SpanContext (bool sampled_flag, bool is_remote )
45
44
: trace_id_(),
46
45
span_id_ (),
47
46
trace_flags_(trace_api::TraceFlags((uint8_t )sampled_flag)),
48
- remote_parent_(has_remote_parent){};
47
+ is_remote_(is_remote)
48
+ {}
49
49
50
50
// @returns whether this context is valid
51
51
bool IsValid () const noexcept { return trace_id_.IsValid () && span_id_.IsValid (); }
@@ -57,14 +57,8 @@ class SpanContext final
57
57
58
58
const trace_api::SpanId &span_id () const noexcept { return span_id_; }
59
59
60
- SpanContext (TraceId trace_id,
61
- SpanId span_id,
62
- TraceFlags trace_flags,
63
- bool has_remote_parent) noexcept
64
- : trace_id_(trace_id),
65
- span_id_(span_id),
66
- trace_flags_(trace_flags),
67
- remote_parent_(has_remote_parent)
60
+ SpanContext (TraceId trace_id, SpanId span_id, TraceFlags trace_flags, bool is_remote) noexcept
61
+ : trace_id_(trace_id), span_id_(span_id), trace_flags_(trace_flags), is_remote_(is_remote)
68
62
{}
69
63
70
64
SpanContext (const SpanContext &ctx) = default;
@@ -77,7 +71,7 @@ class SpanContext final
77
71
trace_flags () == that.trace_flags ();
78
72
}
79
73
80
- bool HasRemoteParent () const noexcept { return remote_parent_ ; }
74
+ bool IsRemote () const noexcept { return is_remote_ ; }
81
75
82
76
static SpanContext GetInvalid () { return SpanContext (false , false ); }
83
77
@@ -87,7 +81,7 @@ class SpanContext final
87
81
trace_api::TraceId trace_id_;
88
82
trace_api::SpanId span_id_;
89
83
trace_api::TraceFlags trace_flags_;
90
- bool remote_parent_ = false ;
84
+ bool is_remote_ = false ;
91
85
};
92
86
} // namespace trace
93
87
OPENTELEMETRY_END_NAMESPACE
0 commit comments