Skip to content

Commit

Permalink
[ASP.NET Core] Do not reset baggage on requeststop
Browse files Browse the repository at this point in the history
  • Loading branch information
Vishwesh Bankwar committed Mar 6, 2023
1 parent 9fdf4fc commit 7c098e7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -286,12 +286,6 @@ public void OnStopActivity(Activity activity, object payload)
// the one created by the instrumentation.
// And retrieve it here, and set it to Current.
}

var textMapPropagator = Propagators.DefaultTextMapPropagator;
if (textMapPropagator is not TraceContextPropagator)
{
Baggage.Current = default;
}
}

public void OnMvcBeforeAction(Activity activity, object payload)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ public async Task ExtractContextIrrespectiveOfTheFilterApplied()
}

[Fact]
public async Task BaggageClearedWhenActivityStopped()
public async Task BaggageIsNotClearedWhenActivityStopped()
{
int? baggageCountAfterStart = null;
int? baggageCountAfterStop = null;
Expand Down Expand Up @@ -532,7 +532,7 @@ void ConfigureTestServices(IServiceCollection services)
Assert.NotNull(baggageCountAfterStart);
Assert.Equal(2, baggageCountAfterStart);
Assert.NotNull(baggageCountAfterStop);
Assert.Equal(0, baggageCountAfterStop);
Assert.Equal(2, baggageCountAfterStop);
}

[Theory]
Expand Down

0 comments on commit 7c098e7

Please sign in to comment.