How datadog/dd-trace-dotnet works
This repository provides Datadog’s .NET APM tracer and continuous profiler. An application is instrumented at supported call sites to create tracing scopes; the repository also includes CI coverage and security/dynamic-instrumentation capabilities. The profiler gathers runtime and platform events and produces profiling data. The sampled sources show Elasticsearch scope creation, Cosmos DB query instrumentation, global-coverage artifact publication, and Windows ETW event handling; other capability branches are represented from the README and tree, with uncertain wiring omitted.
Main entry points: RequestPipeline_CallElasticsearchAsync_Integration.cs Elasticsearch hooks · TracerManager.cs Tracer core · Datadog.Profiler.Native Profiler engine · DatabaseQueryIteratorsIntegrations.cs Cosmos DB hooks
Components 20
Tracing
- Tracer core
tracer/src/Datadog.Trace/TracerManager.cs - CallTarget runtime
tracer/src/Datadog.Trace/ClrProfiler/CallTarget/CallTargetState.cs - CallTarget return
tracer/src/Datadog.Trace/ClrProfiler/CallTarget/CallTargetReturn.cs - Integration registry
tracer/src/Datadog.Trace/Configuration/IntegrationId.cs
Instrumentation
- Elasticsearch hooks
tracer/src/Datadog.Trace/ClrProfiler/AutoInstrumentation/Elasticsearch/V5/RequestPipeline_CallElasticsearchAsync_Integration.cs - Elasticsearch spans
tracer/src/Datadog.Trace/ClrProfiler/AutoInstrumentation/Elasticsearch/ElasticsearchNetCommon.cs - Request adaptation
tracer/src/Datadog.Trace/ClrProfiler/AutoInstrumentation/Elasticsearch/IRequestData.cs - Pipeline adaptation
tracer/src/Datadog.Trace/ClrProfiler/AutoInstrumentation/Elasticsearch/RequestPipelineStruct.cs - Cosmos DB hooks
tracer/src/Datadog.Trace/ClrProfiler/AutoInstrumentation/CosmosDb/DatabaseQueryIteratorsIntegrations.cs - Supported integrations
tracer/src/Datadog.Trace/ClrProfiler/AutoInstrumentation
Product Features
- CI coverage
tracer/src/Datadog.Trace/Ci/Coverage/GlobalCoverageOutputManager.cs - Application security
tracer/src/Datadog.Trace - Dynamic instrumentation
tracer/src/Datadog.Trace/Debugger
Continuous Profiling
- Profiler engine
profiler/src/ProfilerEngine/Datadog.Profiler.Native - Frame store
profiler/src/ProfilerEngine/Datadog.Profiler.Native/FrameStore.h - Profile output
profiler/src/ProfilerEngine/Datadog.Profiler.Native/Exporter.cpp
Platform Support
- ETW event manager
profiler/src/ProfilerEngine/Datadog.Profiler.Native.Windows/EtwEventsManager.cpp - Linux sampling
profiler/src/ProfilerEngine/Datadog.Profiler.Native.Linux - Windows sampling
profiler/src/ProfilerEngine/Datadog.Profiler.Native.Windows
Other components
- .NET application
Connections 20
- .NET application → Elasticsearch hooks: calls instrumented
- Elasticsearch hooks → Elasticsearch spans: creates scope
tracer/src/Datadog.Trace/ClrProfiler/AutoInstrumentation/Elasticsearch/V5/RequestPipeline_CallElasticsearchAsync_Integration.cs - Elasticsearch hooks → CallTarget runtime: returns state
tracer/src/Datadog.Trace/ClrProfiler/AutoInstrumentation/Elasticsearch/V5/RequestPipeline_CallElasticsearchAsync_Integration.cs - Elasticsearch hooks → Request adaptation: reads request
tracer/src/Datadog.Trace/ClrProfiler/AutoInstrumentation/Elasticsearch/V5/RequestPipeline_CallElasticsearchAsync_Integration.cs - Elasticsearch hooks → Pipeline adaptation: adapts pipeline
tracer/src/Datadog.Trace/ClrProfiler/AutoInstrumentation/Elasticsearch/V5/RequestPipeline_CallElasticsearchAsync_Integration.cs - Elasticsearch spans → Tracer core: starts span
tracer/src/Datadog.Trace/ClrProfiler/AutoInstrumentation/Elasticsearch/ElasticsearchNetCommon.cs - Elasticsearch hooks → CallTarget return: returns result
tracer/src/Datadog.Trace/ClrProfiler/AutoInstrumentation/Elasticsearch/V5/RequestPipeline_CallElasticsearchAsync_Integration.cs - Cosmos DB hooks → CallTarget runtime: returns state
tracer/src/Datadog.Trace/ClrProfiler/AutoInstrumentation/CosmosDb/DatabaseQueryIteratorsIntegrations.cs - Cosmos DB hooks → Supported integrations: registers hooks
tracer/src/Datadog.Trace/ClrProfiler/AutoInstrumentation/CosmosDb/DatabaseQueryIteratorsIntegrations.cs - Tracer core → Supported integrations: enables tracing
tracer/src/Datadog.Trace/ClrProfiler/AutoInstrumentation/Elasticsearch/ElasticsearchNetCommon.cs - Tracer core → Integration registry: checks integrations
- .NET application → CI coverage: produces coverage
- CI coverage → Profile output: publishes artifact
- .NET application → Application security: runs protected code
- .NET application → Dynamic instrumentation: runs observed code
- .NET application → Profiler engine: being profiled
- Profiler engine → Linux sampling: uses platform
profiler/src/ProfilerEngine/Datadog.Profiler.Native.Linux/ProfilerSignalManager.cpp - Profiler engine → Windows sampling: uses platform
profiler/src/ProfilerEngine/Datadog.Profiler.Native.Windows/EtwEventsManager.cpp - ETW event manager → Frame store: stores frames
profiler/src/ProfilerEngine/Datadog.Profiler.Native.Windows/EtwEventsManager.cpp - ETW event manager → Profile output: feeds profiling