Commit 0c87ab6
committed
Fix span parenting for isolated Azure Functions with ASP.NET Core integration
When HTTP proxying is enabled (ASP.NET Core integration), the host
makes an HTTP call to the worker process. The HTTP client instrumentation
automatically propagates trace context in HTTP headers.
Previously, we were also injecting the Azure Functions host span context
into the gRPC message, causing worker spans to be incorrectly parented
to the root host span instead of the HTTP client span.
Fix: Skip gRPC context injection when HTTP proxying is enabled, allowing
the HTTP client instrumentation to handle context propagation naturally.
This ensures worker spans are properly parented to the HTTP call span,
creating the correct span hierarchy:
- Root: azure_functions.invoke (host)
- http.request: GET localhost:port (host -> worker)
- azure_functions.invoke (worker)
- (worker child spans)
Fixes APMSVLS-581 parent 466dddb commit 0c87ab6
File tree
1 file changed
+22
-10
lines changed- tracer/src/Datadog.Trace/ClrProfiler/AutoInstrumentation/Azure/Functions/Isolated
1 file changed
+22
-10
lines changedLines changed: 22 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
52 | | - | |
53 | | - | |
| 52 | + | |
54 | 53 | | |
55 | 54 | | |
56 | 55 | | |
| |||
76 | 75 | | |
77 | 76 | | |
78 | 77 | | |
79 | | - | |
80 | 78 | | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
86 | 99 | | |
87 | 100 | | |
88 | 101 | | |
89 | 102 | | |
90 | | - | |
91 | | - | |
| 103 | + | |
92 | 104 | | |
93 | 105 | | |
94 | 106 | | |
0 commit comments