Skip to content

Commit

Permalink
Ensure each invocation of a pipeline has its own Activity
Browse files Browse the repository at this point in the history
This fixes #145.
  • Loading branch information
snake-scaly committed Dec 11, 2024
1 parent 4ae8bdf commit 24ceb2a
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,20 @@ internal sealed class AWSTracingPipelineHandler : PipelineHandler

private static readonly ActivitySource AWSSDKActivitySource = new(ActivitySourceName, typeof(AWSTracingPipelineHandler).Assembly.GetPackageVersion());

private readonly AsyncLocal<Activity?> activity = new();

private readonly AWSClientInstrumentationOptions options;

public AWSTracingPipelineHandler(AWSClientInstrumentationOptions options)
{
this.options = options;
}

public Activity? Activity { get; private set; }
public Activity? Activity
{
get => this.activity.Value;
private set => this.activity.Value = value;
}

public override void InvokeSync(IExecutionContext executionContext)
{
Expand Down

0 comments on commit 24ceb2a

Please sign in to comment.