Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Ensure baggage properties are not interpreted as baggage values #6693

Merged
merged 3 commits into from
Feb 25, 2025

Conversation

zacharycmontoya
Copy link
Contributor

Summary of changes

Fixes an issue where baggage properties were being interpreted as part of a baggage value (each baggage item consists of a key, a value, and properties). The OpenTelemetry Baggage API does not include support for properties, so the decision was made to exclude the propagation of properties, so this change discards them when extracting them from the header.

Reason for change

We've updated our Datadog implementation of baggage to ignore properties, so this puts us in alignment.

Implementation details

When extracting the baggage value, identify the first ; character which signals the start of baggage properties and only extract the value up to that index.

Test coverage

Updated the W3CBaggagePropagatorTests.cs to include examples with baggage properties and the agreed upon result.

I am awaiting tests for system-tests to confirm this behavior.

Other details

…sion for the time being is to exclude them from baggage propagation, which is done here by discarding them when extracting them from the incoming header.
@rachelyangdog
Copy link

Thanks again for calling this out!! LGTM 😁

Copy link
Member

@lucaspimentel lucaspimentel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@lucaspimentel lucaspimentel added the area:tracer The core tracer library (Datadog.Trace, does not include OpenTracing, native code, or integrations) label Feb 24, 2025
@andrewlock
Copy link
Member

andrewlock commented Feb 24, 2025

Execution-Time Benchmarks Report ⏱️

Execution-time results for samples comparing the following branches/commits:

Execution-time benchmarks measure the whole time it takes to execute a program. And are intended to measure the one-off costs. Cases where the execution time results for the PR are worse than latest master results are shown in red. The following thresholds were used for comparing the execution times:

  • Welch test with statistical test for significance of 5%
  • Only results indicating a difference greater than 5% and 5 ms are considered.

Note that these results are based on a single point-in-time result for each branch. For full results, see the dashboard.

Graphs show the p99 interval based on the mean and StdDev of the test run, as well as the mean value of the run (shown as a diamond below the graph).

gantt
    title Execution time (ms) FakeDbCommand (.NET Framework 4.6.2) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (6693) - mean (69ms)  : 66, 72
     .   : milestone, 69,
    master - mean (69ms)  : 66, 72
     .   : milestone, 69,

    section CallTarget+Inlining+NGEN
    This PR (6693) - mean (1,004ms)  : 982, 1027
     .   : milestone, 1004,
    master - mean (1,002ms)  : 981, 1024
     .   : milestone, 1002,

Loading
gantt
    title Execution time (ms) FakeDbCommand (.NET Core 3.1) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (6693) - mean (102ms)  : 99, 105
     .   : milestone, 102,
    master - mean (102ms)  : 100, 104
     .   : milestone, 102,

    section CallTarget+Inlining+NGEN
    This PR (6693) - mean (677ms)  : 661, 694
     .   : milestone, 677,
    master - mean (676ms)  : 656, 696
     .   : milestone, 676,

Loading
gantt
    title Execution time (ms) FakeDbCommand (.NET 6) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (6693) - mean (89ms)  : 86, 92
     .   : milestone, 89,
    master - mean (89ms)  : 87, 92
     .   : milestone, 89,

    section CallTarget+Inlining+NGEN
    This PR (6693) - mean (635ms)  : 620, 650
     .   : milestone, 635,
    master - mean (635ms)  : 618, 652
     .   : milestone, 635,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET Framework 4.6.2) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (6693) - mean (192ms)  : 187, 196
     .   : milestone, 192,
    master - mean (191ms)  : 188, 195
     .   : milestone, 191,

    section CallTarget+Inlining+NGEN
    This PR (6693) - mean (1,111ms)  : 1075, 1146
     .   : milestone, 1111,
    master - mean (1,107ms)  : 1077, 1136
     .   : milestone, 1107,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET Core 3.1) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (6693) - mean (271ms)  : 267, 276
     .   : milestone, 271,
    master - mean (271ms)  : 267, 276
     .   : milestone, 271,

    section CallTarget+Inlining+NGEN
    This PR (6693) - mean (867ms)  : 829, 904
     .   : milestone, 867,
    master - mean (866ms)  : 835, 898
     .   : milestone, 866,

Loading
gantt
    title Execution time (ms) HttpMessageHandler (.NET 6) 
    dateFormat  X
    axisFormat %s
    todayMarker off
    section Baseline
    This PR (6693) - mean (262ms)  : 257, 267
     .   : milestone, 262,
    master - mean (263ms)  : 258, 268
     .   : milestone, 263,

    section CallTarget+Inlining+NGEN
    This PR (6693) - mean (849ms)  : 817, 882
     .   : milestone, 849,
    master - mean (843ms)  : 811, 876
     .   : milestone, 843,

Loading

@zacharycmontoya zacharycmontoya merged commit 91c36c6 into master Feb 25, 2025
143 of 146 checks passed
@zacharycmontoya zacharycmontoya deleted the zach.montoya/baggage-property-fixes branch February 25, 2025 00:42
@github-actions github-actions bot added this to the vNext-v3 milestone Feb 25, 2025
@andrewlock andrewlock added type:enhancement Improvement to an existing feature area:opentelemetry OpenTelemetry support labels Mar 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:opentelemetry OpenTelemetry support area:tracer The core tracer library (Datadog.Trace, does not include OpenTracing, native code, or integrations) type:enhancement Improvement to an existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants