You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/en/data_streams/manual_instrumentation.md
+69Lines changed: 69 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -96,6 +96,75 @@ set_consume_checkpoint(
96
96
97
97
{{< /code-block >}}
98
98
{{% /tab %}}
99
+
{{% tab ".Net" %}}
100
+
The following example propagates the trace context. See [Trace Context Propagation][1] for more information.
101
+
102
+
<divclass="alert alert-warning">
103
+
<strong>Note:</strong> In async operations, this may not work as expected because the context derived from the incoming message can be lost when producing a new message in different threads.
104
+
</div>
105
+
106
+
#### Producer configuration
107
+
108
+
{{< code-block lang="csharp" >}}
109
+
using Datadog.Trace;
110
+
111
+
using (var scope = Tracer.Instance.StartActive("produce"))
112
+
{
113
+
var headers = new Headers();
114
+
var msg = new Message { Value = "<ANY-VALUE>", Headers = headers};
0 commit comments