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
## Summary of changes
Small docs clean-up to resolve pending comments from #7639.
## Reason for change
Improve documentation clarity and structure.
## Implementation details
- `AGENTS.md` 🤖
- Removed reference to old `Datadog.Monitoring.Distribution`
- Added `Datadog.Trace.Bundle`
- `docs/development/AzureFunctions.md`
- Clarified package usage patterns for `Datadog.AzureFunctions` vs
`Datadog.Trace`
- `docs/development/for-ai/AzureFunctions-Architecture.md` 🤖
- moved to `docs/development/for-ai/` subdirectory to indicate AI
agent-focused content
- Updated cross-references to reflect new Azure Functions Architecture
doc location
- Small formatting tweaks
## Test coverage
Documentation changes only - no functional code changes.
---------
Co-authored-by: Claude <[email protected]>
Copy file name to clipboardExpand all lines: AGENTS.md
+8-9Lines changed: 8 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,22 +21,22 @@
21
21
22
22
## NuGet Package Architecture
23
23
24
-
### Datadog.Trace Package
24
+
### `Datadog.Trace` Package
25
25
The `Datadog.Trace` NuGet package provides the **manual instrumentation API** for customers:
26
26
-**Contains**: `Datadog.Trace.Manual.dll` - Public API for manual instrumentation
27
27
-**Does NOT contain**: Auto-instrumentation code or native profiler binaries
28
28
-**Usage**: Reference in application code for manual tracing (e.g., `Tracer.Instance.StartActive()`)
29
29
30
30
Auto-instrumentation comes from the tracer "monitoring home" deployed separately (via installers, MSI, container images, or specialized packages like `Datadog.AzureFunctions`).
31
31
32
-
### Datadog.Trace.dll vs Datadog.Trace.Manual.dll
32
+
### `Datadog.Trace.dll` vs `Datadog.Trace.Manual.dll`
33
33
-`Datadog.Trace.dll` - The full managed tracer with all auto-instrumentation code, loaded by the native profiler into instrumented processes
34
34
-`Datadog.Trace.Manual.dll` - Lightweight manual instrumentation API packaged in the `Datadog.Trace` NuGet package for customer reference
35
35
36
36
### Specialized Packages
37
-
-**Datadog.AzureFunctions**: Bundles `Datadog.Trace.dll` and native profiler for Azure Functions (see `docs/development/AzureFunctions.md`)
38
-
-**Datadog.Monitoring.Distribution**: MSI installer for Windows (IIS, Windows Services)
39
-
- Other serverless/platform-specific packages may bundle the full tracer similarly
37
+
-**Datadog.Trace.Bundle**: Complete bundle with managed/native libraries for all supported .NET runtimes, OS/arch combinations, and products (APM, ASM, Continuous Profiler). An alternative distribution mechanism for auto instrumentation
38
+
-**Datadog.AzureFunctions**: Leaner bundle for Azure Functions (see `docs/development/AzureFunctions.md`)
39
+
- Other serverless/platform-specific packages may bundle the tracer similarly
40
40
41
41
## Tracer Structure
42
42
@@ -217,14 +217,13 @@ tracer/src/Datadog.Trace
217
217
**Quick reference:**
218
218
-**Setup**: Use Azure App Services Site Extension on Windows Premium/Elastic Premium/Dedicated plans; use `Datadog.AzureFunctions` NuGet package for Linux Consumption/Container Apps
219
219
-**Tests**: `BuildAndRunWindowsAzureFunctionsTests` Nuke target; samples under `tracer/test/test-applications/azure-functions/`
-**External Repos**: [Azure Functions Host](https://github.com/Azure/azure-functions-host) and [.NET Worker](https://github.com/Azure/azure-functions-dotnet-worker)
222
221
223
222
📖 **Load when**: Working on Azure Functions instrumentation or debugging serverless issues
224
-
-**`docs/development/AzureFunctions.md`** — In-process vs isolated worker models, instrumentation specifics, ASP.NET Core integration, GRPC context propagation, and debugging guide
223
+
-**`docs/development/AzureFunctions.md`** — Setup, testing, instrumentation specifics, and debugging guide
225
224
226
225
📖 **Load when**: Need detailed architectural understanding of Azure Functions internals
227
-
-**`docs/development/AzureFunctions-Architecture.md`** — Deep dive into Azure Functions Host and .NET Worker architecture, gRPC protocol, middleware model, distributed tracing integration, environment variables, and instrumentation hook points
226
+
-**`docs/development/for-ai/AzureFunctions-Architecture.md`** — Deep dive into Azure Functions Host and .NET Worker architecture, gRPC protocol, and instrumentation hook points
228
227
229
228
📖 **Load when**: Working on AWS Lambda or general serverless instrumentation
230
229
-**`docs/development/Serverless.md`** — Serverless instrumentation patterns across cloud providers
@@ -315,7 +314,7 @@ The tracer runs in-process with customer applications and must have minimal perf
Copy file name to clipboardExpand all lines: docs/development/AzureFunctions.md
+12-10Lines changed: 12 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,7 @@
3
3
This document describes how dd-trace-dotnet integrates with Azure Functions for distributed tracing.
4
4
5
5
**Related Documentation:**
6
-
-[Azure Functions Architecture Deep Dive](AzureFunctions-Architecture.md) - Detailed architectural information about Azure Functions Host and .NET Worker
6
+
-[Azure Functions Architecture Deep Dive](for-ai/AzureFunctions-Architecture.md) - Detailed architectural information about Azure Functions Host and .NET Worker
7
7
8
8
Azure functions operates in one of two ways:
9
9
@@ -16,11 +16,11 @@ Azure functions operates in one of two ways:
16
16
17
17
The `Datadog.AzureFunctions` NuGet package is the primary instrumentation package for Azure Functions. It contains:
18
18
19
-
-**Datadog.Trace.dll** - The full managed tracer with all auto-instrumentation code
-**Datadog.Trace.dll** - The full managed tracer component with all auto-instrumentation code
20
+
-**Native binaries** - Platform-specific native libraries (e.g., `Datadog.Trace.ClrProfiler.Native.so` for Linux)
21
21
-**Monitoring home directory structure** - Deployed to `/home/site/wwwroot/datadog/` (Linux) or equivalent on Windows
22
22
23
-
When profiling is enabled globally (via `CORECLR_ENABLE_PROFILING=1`), the native profiler loads `Datadog.Trace.dll` into **both the host process (`func.exe` or `Microsoft.Azure.WebJobs.Script.WebHost`) and the worker process**. This allows instrumentation code to run in both processes, which is essential for:
23
+
When instrumentation is enabled globally (via `CORECLR_ENABLE_PROFILING=1`), the native profiler loads `Datadog.Trace.dll` into **both the host process (`func.exe` or `Microsoft.Azure.WebJobs.Script.WebHost`) and the worker process**. This allows instrumentation code to run in both processes, which is essential for:
24
24
- Instrumenting host process methods (e.g., `GrpcMessageConversionExtensions.ToRpcHttp()`)
25
25
- Instrumenting worker process methods (e.g., `FunctionExecutionMiddleware`)
26
26
- Ensuring correct trace context propagation across the process boundary
@@ -33,7 +33,7 @@ The `Datadog.Trace` NuGet package is different from `Datadog.AzureFunctions`:
33
33
-**Does NOT contain** auto-instrumentation code or native profiler binaries
34
34
- Used by application code for manual instrumentation (e.g., `Tracer.Instance.StartActive()`)
35
35
36
-
In Azure Functions scenarios, the worker application references `Datadog.Trace` for manual instrumentation, while `Datadog.AzureFunctions` provides the auto-instrumentation. The version of `Datadog.Trace`referenced by the application doesn't need to match `Datadog.AzureFunctions` exactly, as the auto-instrumentation comes entirely from `Datadog.Trace.dll` bundled in `Datadog.AzureFunctions`.
36
+
In Azure Functions scenarios, applications typically only need to reference `Datadog.AzureFunctions`, which provides both auto-instrumentation and pulls in `Datadog.Trace` as a transitive dependency for manual instrumentation APIs. If an application explicitly references `Datadog.Trace`(e.g., for version pinning), the version doesn't need to match `Datadog.AzureFunctions` exactly, as the auto-instrumentation comes entirely from `Datadog.Trace.dll` bundled in `Datadog.AzureFunctions`.
37
37
38
38
## In-process Azure Functions integration
39
39
@@ -47,7 +47,7 @@ We also instrument the `FunctionExecutor`. This provides all the details about t
47
47
48
48
Isolated functions are the only supported model for Azure Functions going forward. In this model, instead of the customer's app being a class library, its a real ASP.NET Core application. The host `func.exe` starts the customer app as a sub process, and sets up a GRPC channel between the two apps. The `func.exe` host acts as a proxy for requests to the customer's app.
49
49
50
-
For detailed information about the isolated worker architecture, gRPC protocol, and middleware model, see [Azure Functions Architecture Deep Dive](AzureFunctions-Architecture.md).
50
+
For detailed information about the isolated worker architecture, gRPC protocol, and middleware model, see [Azure Functions Architecture Deep Dive](for-ai/AzureFunctions-Architecture.md).
51
51
52
52
`func.exe` sets up an in-process Azure Function for every function in the customer's app. Each of the functions in `func.exe` are simple calls that proxy the request to the customer app, and then return the response.
53
53
@@ -113,16 +113,16 @@ gantt
113
113
114
114
### Isolated Azure Functions with ASP.NET Core Integration
115
115
116
-
Isolated Azure Functions also supports an [ASP.NET Core Integration](https://learn.microsoft.com/en-us/azure/azure-functions/dotnet-isolated-process-guide?tabs=hostbuilder%2Cwindows#aspnet-core-integration)that operates differently from the standard gRPC-based communication.
116
+
Isolated Azure Functions also supports an [ASP.NET Core Integration](https://learn.microsoft.com/en-us/azure/azure-functions/dotnet-isolated-process-guide?tabs=hostbuilder%2Cwindows#aspnet-core-integration)mode where the host uses HTTP proxying instead of sending all request details over gRPC.
117
117
118
-
#### HTTP Proxying Architecture
118
+
**For architectural details** about HTTP proxying, YARP, and detection, see [Azure Functions Architecture Deep Dive](for-ai/AzureFunctions-Architecture.md).
119
119
120
120
When ASP.NET Core integration is enabled, the `func.exe` host uses **HTTP proxying** instead of sending all request details over gRPC:
121
121
122
122
1.**Request Reception**: `func.exe` receives the incoming HTTP request
123
123
2.**Capability Detection**: Host checks if worker advertised the `HttpUri` capability
124
-
3.**Minimal gRPC Message**: `GrpcMessageConversionExtensions.ToRpcHttp()` returns an **empty** or minimal gRPC message (see [GrpcMessageConversionExtensions.cs:123-125](https://github.com/Azure/azure-functions-host/blob/dev/src/WebJobs.Script.Grpc/MessageExtensions/GrpcMessageConversionExtensions.cs#L123-L125))
125
-
4.**HTTP Forwarding**: Host uses [YARP (Yet Another Reverse Proxy)](https://microsoft.github.io/reverse-proxy/) to forward the original HTTP request to the worker process via `DefaultHttpProxyService.StartForwarding()` ([source](https://github.com/Azure/azure-functions-host/blob/dev/src/WebJobs.Script/Http/DefaultHttpProxyService.cs#L82-L108))
124
+
3.**Minimal gRPC Message**: `GrpcMessageConversionExtensions.ToRpcHttp()` returns an **empty** or minimal gRPC message (see [GrpcMessageConversionExtensions.cs:123-125](https://github.com/Azure/azure-functions-host/blob/de87f37cec3cf02b3e29716764d4ceb6c2856fa8/src/WebJobs.Script.Grpc/MessageExtensions/GrpcMessageConversionExtensions.cs#L123-L125))
125
+
4.**HTTP Forwarding**: Host uses [YARP (Yet Another Reverse Proxy)](https://microsoft.github.io/reverse-proxy/) to forward the original HTTP request to the worker process via `DefaultHttpProxyService.StartForwarding()` ([source](https://github.com/Azure/azure-functions-host/blob/de87f37cec3cf02b3e29716764d4ceb6c2856fa8/src/WebJobs.Script/Http/DefaultHttpProxyService.cs#L82-L108))
126
126
5.**Worker Processing**: Worker receives the HTTP request and processes the function
127
127
6.**Response Proxying**: Worker's HTTP response is proxied back through the host to the client
128
128
@@ -182,6 +182,8 @@ Worker spans (serialized by PID 56, tagged as "worker"):
182
182
└─ ... (additional spans)
183
183
```
184
184
185
+
<!-- TODO: Update this section if/when span parenting is fixed to properly connect host and worker spans -->
186
+
185
187
**Key insight**: When troubleshooting traces in Datadog, a single distributed trace will contain spans from both processes with different `aas.function.process` tag values. This is expected behavior.
Copy file name to clipboardExpand all lines: docs/development/for-ai/AzureFunctions-Architecture.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,8 +3,8 @@
3
3
This document provides detailed architectural information about Azure Functions Host and .NET Worker, focusing on aspects relevant to dd-trace-dotnet instrumentation and distributed tracing.
4
4
5
5
**Related Documentation:**
6
-
-[Azure Functions Integration Guide](AzureFunctions.md) - Setup, testing, and instrumentation specifics for dd-trace-dotnet
7
-
-[AGENTS.md](../../AGENTS.md) - Repository structure and development guidelines
6
+
-[Azure Functions Integration Guide](../AzureFunctions.md) - Setup, testing, and instrumentation specifics for dd-trace-dotnet
7
+
-[AGENTS.md](../../../AGENTS.md) - Repository structure and development guidelines
0 commit comments