Edit

Share via


DistributedContextPropagator.Inject Method

Definition

Injects the trace values stored in the Activity object into a carrier. For example, into the headers of an HTTP request.

public abstract void Inject(System.Diagnostics.Activity? activity, object? carrier, System.Diagnostics.DistributedContextPropagator.PropagatorSetterCallback? setter);

Parameters

activity
Activity

The Activity object has the distributed context to inject to the carrier.

carrier
Object

The medium in which the distributed context will be stored.

setter
DistributedContextPropagator.PropagatorSetterCallback

The callback method to invoke to set a named key-value pair on the carrier.

Applies to

Product Versions
.NET 6, 7, 8 (package-provided), 8, 9 (package-provided), 9, 10 (package-provided), 10
.NET Standard 2.0 (package-provided)