Skip to content
Prev Previous commit
Next Next commit
Tweaks.
  • Loading branch information
CodeBlanch committed Jan 23, 2025
commit 4f1829c3e1c83a37c226570e9d172a43dbc28845
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ static OtlpTraceExporterTests()
var listener = new ActivityListener
{
ShouldListenTo = _ => true,
Sample = (ref ActivityCreationOptions<ActivityContext> options) => ActivitySamplingResult.AllDataAndRecorded,
Sample = (ref ActivityCreationOptions<ActivityContext> options) => options.Parent.TraceFlags.HasFlag(ActivityTraceFlags.Recorded)
? ActivitySamplingResult.AllDataAndRecorded
: ActivitySamplingResult.AllData,
};

ActivitySource.AddActivityListener(listener);
Expand Down