Skip to content

Commit e71828e

Browse files
Merge branch 'master' into nacho/IISASMretry
2 parents 8894c31 + 59deeab commit e71828e

File tree

291 files changed

+10493
-5223
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

291 files changed

+10493
-5223
lines changed

.azure-pipelines/ultimate-pipeline.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ pr:
3333
- docs/
3434
- tracer/README.MD
3535
- tracer/samples/
36+
- tracer/tools/Build-AzureFunctionsNuget.ps1
3637
- AGENTS.md
3738
- LICENSE
3839
- NOTICE

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@
109109
/tracer/test/Datadog.Trace.ClrProfiler.Managed.Tests/HttpBypassTests.cs @DataDog/tracing-dotnet @DataDog/apm-serverless @DataDog/serverless-azure-and-gcp
110110
/tracer/samples/AzureFunctionsWithAgentLessLogging/ @DataDog/tracing-dotnet @DataDog/apm-serverless @DataDog/serverless-azure-and-gcp
111111
/docs/development/**/AzureFunctions*.md @DataDog/tracing-dotnet @DataDog/apm-serverless @DataDog/serverless-azure-and-gcp
112+
/tracer/tools/Build-AzureFunctionsNuget.ps1 @DataDog/apm-serverless
112113

113114
## Serverless (GCP)
114115
/tracer/src/**/*GCP*.cs @DataDog/tracing-dotnet @DataDog/apm-serverless @DataDog/serverless-azure-and-gcp

.github/labeller.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ labels:
4747
- name: "area:builds"
4848
title: "^\\[?(?i)build"
4949

50+
- name: "area:builds"
51+
title: "^\\[?(?i)(version bump)"
52+
5053
- name: "area:ssi"
5154
title: "^\\[?(?i)(fleet installer)"
5255

.gitlab-ci.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,10 +248,11 @@ dsm_throughput:
248248
- when: manual
249249

250250

251-
validate_supported_configurations_local_file:
251+
validate_supported_configurations_v2_local_file:
252252
stage: build
253253
rules:
254254
- when: on_success
255-
extends: .validate_supported_configurations_local_file
255+
extends: .validate_supported_configurations_v2_local_file
256256
variables:
257257
LOCAL_JSON_PATH: "tracer/src/Datadog.Trace/Configuration/supported-configurations.json"
258+
BACKFILLED: true

.gitlab/benchmarks/macrobenchmarks.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -743,6 +743,12 @@ check-slo-breaches:
743743
DDOCTOSTS_POLICY: "gitlab.github-access.read-contents"
744744
ARTIFACTS_DIR: "reports"
745745
SLO_FILE: ".gitlab/benchmarks/bp-runner.fail-on-breach.yml"
746+
artifacts:
747+
name: "artifacts"
748+
when: always
749+
paths:
750+
- reports/
751+
expire_in: 3 months
746752

747753
notify-slo-breaches:
748754
extends: .notify-slo-breaches

.gitlab/one-pipeline.locked.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# DO NOT EDIT THIS FILE MANUALLY
1+
# DO NOT EDIT THIS FILE MANUALLY
22
# This file is auto-generated by automation.
33
include:
4-
- remote: https://gitlab-templates.ddbuild.io/libdatadog/one-pipeline/ca/75745fafbee537a84b24d8d5fe735299438cbe46d6949d686cd73818296c5f44/one-pipeline.yml
4+
- remote: https://gitlab-templates.ddbuild.io/libdatadog/one-pipeline/ca/f14ac28614630d12bcfe6cba4fd8d72dce142c62ff0b053ba7c323622104ebd7/one-pipeline.yml

AGENTS.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -396,6 +396,15 @@ The tracer runs in-process with customer applications and must have minimal perf
396396
- `docs/development/CI/TroubleshootingCIFailures.md` — Investigating build/test failures in Azure DevOps
397397
- `docs/development/CI/RunSmokeTestsLocally.md` — Running smoke tests locally
398398

399+
## Configuration
400+
401+
📖 **Load when**: Need reference for tracer configuration settings and environment variables
402+
- **`tracer/src/Datadog.Trace/Configuration/supported-configurations-docs.yaml`** — Human-readable descriptions and default values for all `DD_*` environment variables
403+
- **`tracer/src/Datadog.Trace/Configuration/supported-configurations.json`** — Machine-readable config metadata: product categorization, key aliases, and deprecations (consumed by source generators)
404+
405+
📖 **Load when**: Adding a new `DD_*` configuration key or modifying the configuration system
406+
- **`docs/development/Configuration/AddingConfigurationKeys.md`** — Step-by-step guide for adding config keys: JSON/YAML definitions, source generators, aliases, telemetry normalization, and related analyzers
407+
399408
## Security & Configuration
400409

401410
- Do not commit secrets; prefer env vars (`DD_*`). `.env` should not contain credentials.

docs/development/Configuration/AddingConfigurationKeys.md

Lines changed: 42 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ This guide explains how to add new configuration keys to the .NET Tracer. Config
2222

2323
Configuration keys in the .NET Tracer are defined in two source files:
2424

25-
- **`tracer/src/Datadog.Trace/Configuration/supported-configurations.json`** - Defines the configuration keys, their
25+
- **`tracer/src/Datadog.Trace/Configuration/supported-configurations.json`** - Defines the configuration keys, their
2626
environment variable names, and optional fallbacks.
27-
- **`tracer/src/Datadog.Trace/Configuration/supported-configurations-docs.yaml`** - Contains XML documentation for
27+
- **`tracer/src/Datadog.Trace/Configuration/supported-configurations-docs.yaml`** - Contains XML documentation for
2828
each key. We're using yaml here as it makes it easier for some of the long documentation summaries and formatting.
2929

3030
Two source generators read these files at build time:
@@ -40,22 +40,39 @@ Two source generators read these files at build time:
4040

4141
### 1. Add the Configuration Key Definition
4242

43-
Add your new configuration key to `tracer/src/Datadog.Trace/Configuration/supported-configurations.json`, specifying
44-
an arbitrary version string (e.g. `"A"`, as shown below). and specifying the product if required. Any product name
45-
is allowed, but try to reuse the existing ones (see [Common products](#common-products)) if it makes sense, as they will create another partial class, ie
43+
Add your new configuration key to `tracer/src/Datadog.Trace/Configuration/supported-configurations.json`, specifying
44+
an implementation string (`"A"` being the default one, as shown below) and specifying the product if required. Any product name
45+
is allowed, but try to reuse the existing ones (see [Common products](#common-products)) if it makes sense, as they will create another partial class, ie
4646
ConfigurationKeys.ProductName.cs. Without a product name, the keys will go in the main class, ConfigurationKeys.cs.
4747

48+
**Required fields (mandatory):**
49+
- `implementation`: The implementation identifier
50+
- `"A"` being the default one, it needs to match the registry implementation with the same type and default values
51+
- `type`: The type of the configuration value (for example `string`, `boolean`, `int`, `decimal`)
52+
- `default`: The default value applied by the tracer when the env var is not set. Use `null` if there is no default.
53+
54+
These fields are mandatory to keep the configuration registry complete and to ensure consistent behavior and documentation across products.
55+
4856
**Example:**
4957
```json
5058
{
59+
"version": "2",
5160
"supportedConfigurations": {
52-
"DD_TRACE_SAMPLE_RATE": {
53-
"version": ["A"]
54-
},
55-
"OTEL_EXPORTER_OTLP_TIMEOUT": {
56-
"version": ["A"],
57-
"product": "OpenTelemetry"
58-
}
61+
"DD_TRACE_SAMPLE_RATE": [
62+
{
63+
"implementation": "A",
64+
"type": "decimal",
65+
"default": null
66+
}
67+
],
68+
"OTEL_EXPORTER_OTLP_TIMEOUT": [
69+
{
70+
"implementation": "A",
71+
"type": "int",
72+
"default": null,
73+
"product": "OpenTelemetry"
74+
}
75+
]
5976
}
6077
}
6178
```
@@ -84,13 +101,22 @@ OTEL_EXPORTER_OTLP_LOGS_TIMEOUT: |
84101

85102
### 3. (Optional) Add Aliases
86103

87-
Configuration keys can have **aliases** that are checked in order of appearance when the primary key is not found. Add them to the `aliases` section in `supported-configurations.json`:
104+
Configuration keys can have **aliases** that are checked in order of appearance when the primary key is not found. Add them to the `aliases` property of the configuration entry in `supported-configurations.json`:
88105

89106
```json
90107
{
91-
"aliases": {
108+
"version": "2",
109+
"supportedConfigurations": {
92110
"OTEL_EXPORTER_OTLP_LOGS_TIMEOUT": [
93-
"OTEL_EXPORTER_OTLP_TIMEOUT"
111+
{
112+
"implementation": "A",
113+
"type": "int",
114+
"default": null,
115+
"product": "OpenTelemetry",
116+
"aliases": [
117+
"OTEL_EXPORTER_OTLP_TIMEOUT"
118+
]
119+
}
94120
]
95121
}
96122
}
@@ -384,7 +410,7 @@ dotnet build tracer/src/Datadog.Trace/Datadog.Trace.csproj
384410

385411
## Related Files
386412

387-
- **Source generators:**
413+
- **Source generators:**
388414
- `tracer/src/Datadog.Trace.SourceGenerators/Configuration/ConfigurationKeysGenerator.cs` - Generates configuration key constants
389415
- `tracer/src/Datadog.Trace.SourceGenerators/Configuration/ConfigKeyAliasesSwitcherGenerator.cs` - Generates alias resolution logic
390416
- **Configuration source:** `tracer/src/Datadog.Trace/Configuration/supported-configurations.json`

profiler/src/ProfilerEngine/Datadog.Profiler.Native/FrameworkThreadInfo.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,11 @@ HANDLE FrameworkThreadInfo::GetOsThreadHandle() const
2828
std::string FrameworkThreadInfo::GetProfileThreadId()
2929
{
3030
std::stringstream buffer;
31-
buffer << "<0> [#" << _osThreadId << "]";
31+
buffer << _osThreadId;
3232
return buffer.str();
3333
}
3434

3535
std::string FrameworkThreadInfo::GetProfileThreadName()
3636
{
37-
std::stringstream buffer;
38-
buffer << "Managed thread (name unknown) [#" << _osThreadId << "]";
39-
return buffer.str();
37+
return std::string("");
4038
}

profiler/src/ProfilerEngine/Datadog.Profiler.Native/ManagedCodeCache.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
// Represents a single contiguous code range
2828
struct CodeRange {
2929
UINT_PTR startAddress;
30-
UINT_PTR endAddress; // Exclusive
30+
UINT_PTR endAddress; // Inclusive
3131
FunctionID functionId;
3232

3333
// For binary search
@@ -37,14 +37,14 @@ struct CodeRange {
3737

3838
// Check if IP is within this range
3939
bool contains(UINT_PTR ip) const {
40-
return ip >= startAddress && ip < endAddress;
40+
return ip >= startAddress && ip <= endAddress;
4141
}
4242
};
4343

4444

4545
struct ModuleCodeRange {
4646
UINT_PTR startAddress;
47-
UINT_PTR endAddress;
47+
UINT_PTR endAddress; // Inclusive
4848
bool isRemoved = false;
4949
// For binary search
5050
bool operator<(const ModuleCodeRange& other) const {
@@ -53,7 +53,7 @@ struct ModuleCodeRange {
5353

5454
// Check if IP is within this range
5555
bool contains(std::uintptr_t ip) const {
56-
return ip >= startAddress && ip < endAddress;
56+
return ip >= startAddress && ip <= endAddress;
5757
}
5858
};
5959

0 commit comments

Comments
 (0)