when tracing is disabled globally, new spans won't be added
to existing traces, because of that if condition.
this can happen also if a specific trace was enabled by lua script
so in case tracing is disabled, the tracer will create new spans
if it's parent span is not a noop span, regardless of tracer state
Signed-off-by: Omri Zeneva <ozeneva@redhat.com>
}
jspan Tracer::add_span(opentelemetry::nostd::string_view span_name, const jspan& parent_span) {
- ceph_assert(cct);
- if (is_enabled() && parent_span->IsRecording()) {
+ if (parent_span && parent_span->IsRecording()) {
ceph_assert(tracer);
opentelemetry::trace::StartSpanOptions span_opts;
span_opts.parent = parent_span->GetContext();
}
jspan Tracer::add_span(opentelemetry::nostd::string_view span_name, const jspan_context& parent_ctx) {
- ceph_assert(cct);
- if (is_enabled() && parent_ctx.IsValid()) {
+ if (parent_ctx.IsValid()) {
ceph_assert(tracer);
opentelemetry::trace::StartSpanOptions span_opts;
span_opts.parent = parent_ctx;