Skip to content

Commit

Permalink
Merge branch 'main' into fix-attributes-processor
Browse files Browse the repository at this point in the history
  • Loading branch information
lalitb authored Jan 29, 2024
2 parents b349be3 + 732f0b2 commit 12f3ee2
Show file tree
Hide file tree
Showing 21 changed files with 1,461 additions and 1,023 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/project_management_comment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
issues: write
steps:
- name: Add comment
uses: peter-evans/create-or-update-comment@23ff15729ef2fc348714a3bb66d2f655ca9066f2
uses: peter-evans/create-or-update-comment@71345be0265236311c031f5c7866368bd1eff043
with:
issue-number: ${{ github.event.issue.number }}
body: |
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ Increment the:

## [Unreleased]

* [API] Fix b3, w3c and jaeger propagators: they will not overwrite
the active span with a default invalid span, which is especially useful
when used with CompositePropagator
[TEST] fix string "current-span" to trace:kSpan which is "active_span"
[#2511](https://github.com/open-telemetry/opentelemetry-cpp/pull/2511)
* [REMOVAL] Remove option WITH_OTLP_HTTP_SSL_PREVIEW
[#2435](https://github.com/open-telemetry/opentelemetry-cpp/pull/2435)
* [BUILD] Fix removing of NOMINMAX on Windows
Expand Down
9 changes: 8 additions & 1 deletion api/include/opentelemetry/trace/propagation/b3_propagator.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,14 @@ class B3PropagatorExtractor : public context::propagation::TextMapPropagator
{
SpanContext span_context = ExtractImpl(carrier);
nostd::shared_ptr<Span> sp{new DefaultSpan(span_context)};
return trace::SetSpan(context, sp);
if (span_context.IsValid())
{
return trace::SetSpan(context, sp);
}
else
{
return context;
}
}

static TraceId TraceIdFromHex(nostd::string_view trace_id)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,14 @@ class HttpTraceContext : public context::propagation::TextMapPropagator
{
SpanContext span_context = ExtractImpl(carrier);
nostd::shared_ptr<Span> sp{new DefaultSpan(span_context)};
return trace::SetSpan(context, sp);
if (span_context.IsValid())
{
return trace::SetSpan(context, sp);
}
else
{
return context;
}
}

static TraceId TraceIdFromHex(nostd::string_view trace_id)
Expand Down
9 changes: 8 additions & 1 deletion api/include/opentelemetry/trace/propagation/jaeger.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,14 @@ class OPENTELEMETRY_DEPRECATED JaegerPropagator : public context::propagation::T
{
SpanContext span_context = ExtractImpl(carrier);
nostd::shared_ptr<Span> sp{new DefaultSpan(span_context)};
return trace::SetSpan(context, sp);
if (span_context.IsValid())
{
return trace::SetSpan(context, sp);
}
else
{
return context;
}
}

bool Fields(nostd::function_ref<bool(nostd::string_view)> callback) const noexcept override
Expand Down
Loading

0 comments on commit 12f3ee2

Please sign in to comment.