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
{{ message }}
Repository navigation
Review learning: rule changes from 2026-10-27 to 2026-11-25 - #9829
Monthly review learning. 2 changes to the code review rules, learned from the 212 PRs merged from 2026-10-27 to 2026-11-25.
Review them in Files changed, and answer on each rule: ok, discard, a suggestion, or a comment. Once a day, a workflow applies the answers and replies.
More changes stayed out of this PR. They are in the folded sections below. Open a row for what the rule does, why, the examples and the evidence. If one is worth it, comment add <ID>: the workflow adds it to this PR.
12 need your decision: the judge or the replay could not check them.
13 have evidence from one PR only.
7 were left out by the judge or the replay, with the reason.
15 lessons were sent from one lens to another, and no lens took them.
The changes with evidence from one PR only, or over the limit, are kept. If the next months bring more evidence, they can come back in a later PR, with no action from you.
Merged PRs
With human review
Fixes linked to their cause
Verified lessons
Proposals
Changes in this PR
212
194
36
114
55
2
🆕 New rules (1)
Rules that the review does not have yet. Open the last cell of a row for what it does, why, a bad and a good example, and the evidence.
Rule
Lens
Change
Evidence
Why, and examples
COR-5.5
Correctness
new rule: Check for an existing separator or suffix before appending a path part
Two PRs duplicated a path part by appending it without a check: the Front Door proxy path and the OTLP signal path.
What it does: code that always prepends / or appends a path segment such as v1/<signal> to a configured or header value. If the value already has it, the result is //path or /v1/logs/v1/logs.
Why is this bad? Two PRs duplicated a path part by appending it without a check: the Front Door proxy path and the OTLP signal path.
Tested examples
❌ Bad code from #8861: the review caught it with COR-5.5.
#8861correction: "It would also be helpful to link the Front Door rule configuration that guarantees the header uses {url_path}. e.g. this is set headers.Set(InferredProxyHeaders.Path, "/api/test"); Additionally, it may be best to conditionally add the / if we see it missing we add it if we see it there we skip it."
#9505correction: "Edge case for logs: if OTEL_EXPORTER_OTLP_ENDPOINT already ends with the signal path, e.g. http://c:4318/v1/logs with an HTTP logs protocol, this appends it again and we send to http://c:4318/v1/logs/v1/logs, so the collector returns 404."
🔧 Existing rules, tuned (1)
Rules that exist, with a new case, a new exception, or better words. The Change column says which. Open the last cell of a row for the details.
Reviewers flagged tests that changed global state with only a restorer attribute and no non-parallel collection.
What it does: unit tests using a SomeType.Instance singleton, [TracerRestorer]/SetTracer, or Tracer.Instance where a locally constructed instance would do, or a Reset()/Clear() added to production state only so tests can reuse it. If a test changes process-wide static state such as Tracer.Instance or Baggage.Current, its class must be in a non-parallel test collection. A restorer attribute alone does not stop the race.
Why is this bad? Reviewers flagged tests that changed global state with only a restorer attribute and no non-parallel collection. The current Flag does not cover that case.
Tested examples
❌ Bad code from #9479: the review caught it with COR-6.1.
#9479correction: "🟠 HIGH · SDK P2 · COR-6.1: At tracer/test/Datadog.Trace.Tests/ClrProfiler/AutoInstrumentation/Azure/Functions/AzureFunctionsCommonTests.cs:154, this test publishes its tracer process-wide, but the class is not in a nonparallel collection. [TracerRestorer] restores the previous tracer afterward; it does not synchronize concurrent tests."
#9529correction: "Adding this attribute alone isn't sufficient - you'll have to put it (and any tests that use it) in a collection to disable parallel execution too."
Out of this PR
🧑⚖️ 12 changes need your decision. The judge or the replay could not check them. Comment add <ID> to bring one into this PR.
A stub declared string[] while the integration that replaces it used string?[]?.
Why is this bad? A stub declared string[] while the integration that replaces it used string?[]?. That is a nullability mismatch the current Flag does not name.
Current:
null! (or a ! suppression) used to store or return a real null into a non-nullable type, or a property/signature whose nullability differs from what its converter/deserializer produces.
Proposed:
null! (or a ! suppression) used to store or return a real null into a non-nullable type, or a property/signature whose nullability differs from what its converter/deserializer produces. Also flag a manual-instrumentation stub whose signature nullability differs from the tracer integration that replaces it.
Evidence:
#9642correction: "This signature does not match your original."
Whitespace-only OTEL values counted as set and were then trimmed to empty, so the fallback was skipped.
Why is this bad? Whitespace-only OTEL values counted as set and were then trimmed to empty, so the fallback was skipped. The rule only names the empty string.
Current:
value ?? fallback on a string where "" is not a meaningful value (paths, URLs, names).
Proposed:
value ?? fallback on a string where "" is not a meaningful value (paths, URLs, names). If a whitespace-only value is also not meaningful, flag a check that treats it as set.
Evidence:
#9497correction: "What about a string with only spaces?"
COR-2.5
Correctness
new rule: Make check-then-act sequences on shared state atomic
Three PRs had check-then-act races: an isFirst check, a log-once flag, and a File.Exists-then-open.
Why is this bad? Three PRs had check-then-act races: an isFirst check, a log-once flag, and a File.Exists-then-open. The existing concurrency rules cover field visibility, CompareExchange results, and dispose checks, but not this general race.
Proposed rule:
COR-2.5: Make check-then-act sequences on shared state atomic
Flag: a check of shared state and a dependent action, with no lock or atomic operation joining them. Examples are a log-once flag, a first-update check, or File.Exists before opening the file. Use Interlocked.CompareExchange, a shared lock, or FileMode.CreateNew instead.
❌ if (!_logged) { _logged = true; Log.Warning(...); }
Only the CircularChannel reader handled abandoned mutexes.
Why is this bad? Only the CircularChannel reader handled abandoned mutexes. The constructor and writer kept the lock, and other processes timed out.
Proposed rule:
COR-2.6: Handle AbandonedMutexException at every wait on a shared mutex
Flag: one WaitOne site on a cross-process mutex handles AbandonedMutexException, but other sites do not. An abandoned wait still gives the caller ownership. If a change handles it at one site, it must also handle it at every other wait on that mutex.
✅ if (!TryAcquireMutex(mutex, timeout)) { return; } // treats an abandoned mutex as acquired
In Kafka and Hangfire consumers, baggage leaked between messages and into batch processing.
Why is this bad? In Kafka and Hangfire consumers, baggage leaked between messages and into batch processing. No rule covers restoring ambient state.
Proposed rule:
COR-5.7: Restore ambient state set per message when the unit of work ends
Flag: consumer instrumentation that sets ambient state, such as Baggage.Current, from a message. The instrumentation does not restore the previous value when the consumer scope closes. Consumer loops reuse one execution context, so the state leaks to later messages.
❌ Merge the message baggage into Baggage.Current and never restore it.
✅ Assign the message baggage in a BaggageScope that restores the previous baggage on close.
#9529correction: "IIUC, for the "batch" case (which is one of the most common approaches), this leaves the baggage item for the "last" message as the ambient baggage."
COR-5.11
Correctness
new rule: Release per-call resources on every exit path
WAF subcontexts leaked when OnDownstreamRequest threw.
Why is this bad? WAF subcontexts leaked when OnDownstreamRequest threw. COR-5.2 covers stream ownership only.
Proposed rule:
COR-5.11: Release per-call resources on every exit path
Flag: a resource opened for one call, such as a WAF subcontext, that is closed only on the success path. If the call throws, the resource leaks. Close it in a finally block.
Evidence:
#9650correction: "Are we guaranteed to always call CloseSubcontext? Even in case of exceptions etc?"
COR-5.12
Correctness
new rule: Fail safe when a safety-related read fails
A failed GetCustomAttributesData read turned off failure protection, so quarantine could hide a critical failure.
Why is this bad? A failed GetCustomAttributesData read turned off failure protection, so quarantine could hide a critical failure.
Proposed rule:
COR-5.12: Fail safe when a safety-related read fails
Flag: an error handler that falls back to a permissive default when it cannot read safety metadata. An example is a failed attribute read that sets protection flags to false. Treat the state as unknown, or retry another way.
Evidence:
#9578correction: "This should be rare. Fix: on a read error, retry another way or treat the state as unknown, so that it doesn't enable suppression."
XSDK-1.2
Cross-SDK-Consistency
new rule: Bump the implementation version in supported-configurations.yaml when a key's behaviour changes
The configuration registry shared across SDKs tracks behaviour through implementation versions.
Why is this bad? The configuration registry shared across SDKs tracks behaviour through implementation versions. No rule asks for a bump when the semantics of a key change.
Proposed rule:
XSDK-1.2: Bump the implementation version in supported-configurations.yaml when a key's behaviour changes
Flag: a change to what an existing configuration key does, with no new implementation version for that key in supported-configurations.yaml.
❌ OTEL_SDK_DISABLED now also disables logs and metrics, and its implementation version stays the same.
✅ OTEL_SDK_DISABLED gets a new implementation version, such as D, when its scope widens.
Evidence:
#9514correction: "Do we need a new implementation version that indicates we disable traces, logs, and metrics?"
Why is this bad? PERF-3.2 covers argument work in Log.Debug only. The evidence shows an unguarded Log.Warning that allocates an object[] for more than three arguments, and a costly logging helper that left the level check to its callers.
Current:
Log.Debug(...) in an integration callback whose arguments call methods (e.g. GetType()), evaluated even when debug logging is off.
Proposed:
Log.Debug(...) in an integration callback whose arguments call methods (e.g. GetType()), evaluated even when debug logging is off. Also flag a Log.* call with more than three arguments and no Log.IsEnabled guard, because it allocates an object[]. Also flag an expensive log-formatting helper that relies on each caller to check Log.IsEnabled instead of checking inside.
Evidence:
#9568correction: "The new object[] below is guarded with if (Log.IsEnabled(LogEventLevel.Debug)), but this one isn't, so we pay the price for this new object[] allocation even if "warning" logs are disabled (for example if log level is "error")."
#9465correction: "I would be inclined to move the debug logging enabled check inside this method, given it's so expensive if you get it wrong, but you wouldn't know you got it wrong, because you still wouldn't have a log 😅"
PERF-2.6
Performance
new rule: Use a generic struct host interface instead of delegates for test seams
A reviewer pointed out that delegate-based test seams add heap allocations and delegate-call overhead.
Why is this bad? A reviewer pointed out that delegate-based test seams add heap allocations and delegate-call overhead. The author switched to the struct host interface that the repo prefers. No rule in any lens covers this.
Proposed rule:
PERF-2.6: Use a generic struct host interface instead of delegates for test seams
Flag: Func/Action delegates or Stopwatch.StartNew() calls added to tracer code only so that tests can fake time or behaviour.
❌ Func<TimeSpan> elapsedProvider passed into the type only so that a test can fake it
✅ a generic type parameter constrained to a struct host interface, with a test implementation of that interface
Evidence:
#9568correction: "Using delegates for this add a few additional heap allocations and a bit of overhead for the delegate invocation."
1️⃣ 13 changes with evidence from one PR only. They wait for more evidence in the next months. Comment add <ID> to bring one into this PR.
Rule
Lens
Change
Evidence
Why, and examples
COR-1.3
Correctness
new rule: Use is { } x, not is var x, to check for null
Continuation generators swallowed AppSec blocks and lost task results.
Why is this bad? Continuation generators swallowed AppSec blocks and lost task results. COR-5.4 covers a different OnMethodEnd interaction.
Proposed rule:
COR-5.9: Rethrow CallTargetBubbleUpException from CallTarget continuation catch blocks
Flag: a catch block in a CallTarget async continuation handler that catches every exception from the integration. It swallows CallTargetBubbleUpException, which AppSec uses to block. Also flag a continuation that loses the original task result or skips scope restoration when the integration throws.
✅ catch (Exception ex) when (!CallTargetBubbleUpException.IsCallTargetBubbleUpException(ex))
The OTLP schema requires unique attribute keys, and a consumer that keeps the last value loses data.
Why is this bad? The OTLP schema requires unique attribute keys, and a consumer that keeps the last value loses data. No existing rule covers this spec contract.
Proposed rule:
XSDK-3.2: Write each attribute key once per OTLP span
Flag: OTLP export code that writes attributes from several sources, such as MetaStruct and tags. The code does not check for duplicate keys.
❌ MetaStruct appsec and a tag named appsec are both written as span attributes.
✅ Skip a tag or metric whose key was already written from MetaStruct.
Evidence:
#9715correction: "The OTLP schema requires unique attribute keys, and a consumer that keeps the last value would lose the security report."
XSDK-3.3
Cross-SDK-Consistency
new rule: Keep the Default sampling mechanism when replacing the agent sampling rule
The sampling decision maker and priority values are a cross-SDK and backend contract.
Why is this bad? The sampling decision maker and priority values are a cross-SDK and backend contract. Emulating defaults with a user rate misattributes the ingestion reason and drops traces.
Proposed rule:
XSDK-3.3: Keep the Default sampling mechanism when replacing the agent sampling rule
Flag: a change that emulates the default sampler with an explicit sample rate, such as a global rate of 1.0. Such traces report _dd.p.dm=-3 and priority 2. The user-rule rate limiter can also drop them.
❌ In OTLP mode, the global sample rate defaults to 1.0 to keep all traces.
✅ Register a match-all rule with rate 1 and the Default mechanism, such as OtlpDefaultSamplingRule.
Azure Container Apps detection was added to TracerSettings although it is not a setting.
Why is this bad? Azure Container Apps detection was added to TracerSettings although it is not a setting. The reviewer moved it to AzureInfo. The current Flag does not name environment detection or TracerSettings.
Current:
discovery, parsing, matching, or integration-specific lookup logic added to a class whose name doesn't cover it (for example, CODEOWNERS parsing in CIEnvironmentValues, or a WCF OperationContext lookup in ProbeProcessor).
Proposed:
discovery, parsing, matching, or integration-specific lookup logic added to a class whose name doesn't cover it (for example, CODEOWNERS parsing in CIEnvironmentValues, or a WCF OperationContext lookup in ProbeProcessor). This includes hosting environment detection added to TracerSettings. If a check detects a serverless environment, put it in the matching Datadog.Trace.Serverless*Info class.
Evidence:
#9479correction: "This should probably live in Datadog.Trace.Serverless.AzureInfo since it's not actually a tracer setting."
Two PRs relied on callers to do a required step before an API call: a debug-level check before expensive logging, and a lock before ReportWafRequests.
Why is this bad? Two PRs relied on callers to do a required step before an API call: a debug-level check before expensive logging, and a lock before ReportWafRequests. The reviewers moved the step into the method. No rule covers this API shape.
Proposed rule:
DES-3.8: Enforce preconditions inside the method
Flag: callers must take a lock or check the log level before a call. Nothing enforces that step. Move the lock or the check inside the method.
❌ Each caller of ReportWafRequests must already hold the lock.
✅ ReportWafRequests takes the lock itself. The logging helper checks the debug level itself.
Evidence:
#9465correction: "I would be inclined to move the debug logging enabled check inside this method, given it's so expensive if you get it wrong, but you wouldn't know you got it wrong, because you still wouldn't have a log 😅"
#9699correction: "AFAICT, there's nothing that enforces this, which seems like a potential issue..."
DES-6.4
Design
new rule: Change every producer and consumer of artifact names when the version scheme changes
When the build gained a prerelease-aware FullVersion, the Linux artifact names and the consuming docker action kept the 3-part Version.
Why is this bad? When the build gained a prerelease-aware FullVersion, the Linux artifact names and the consuming docker action kept the 3-part Version. As a result, prerelease and release packages looked the same. No build rule covers this.
Proposed rule:
DES-6.4: Change every producer and consumer of artifact names when the version scheme changes
Flag: a build version scheme change, such as a new FullVersion, that leaves some artifact names on the old Version. This includes package metadata and consuming workflow actions. If the version scheme changes, every producer and consumer of those names must also change.
❌ Linux package artifact names that still use the 3-part Version.
✅ Artifact names, the dd-dotnet script version, and the docker action inputs all use FullVersion.
The libunwind ExternalProject kept a prefix that did not depend on the pin and had updates disabled.
Why is this bad? The libunwind ExternalProject kept a prefix that did not depend on the pin and had updates disabled. A reused build folder could therefore build the profiler with a stale dependency. No rule covers this.
Proposed rule:
DES-6.5: Tie the build folder of a pinned external dependency to its pin
Flag: a CMake ExternalProject_Add with UPDATE_COMMAND "" and a fixed PREFIX whose GIT_TAG pin changes. If the pin changes, the build folder must change too. Otherwise a reused folder keeps the old checkout and libraries.
❌ A new GIT_TAG with the fixed prefix libunwind-prefix.
✅ A PREFIX that includes the first 12 characters of the pinned SHA.
Datadog.Trace.Tests took a Microsoft.Azure.Cosmos reference to reproduce disposal behaviour, and the author replaced it with a mock.
Why is this bad? Datadog.Trace.Tests took a Microsoft.Azure.Cosmos reference to reproduce disposal behaviour, and the author replaced it with a mock.
Current:
a test csproj adding a direct PackageReference already provided by a referenced project (e.g. TestHelpers), or a custom <Target> with <Copy> to move a referenced project's output.
Proposed:
a test csproj adding a direct PackageReference already provided by a referenced project (e.g. TestHelpers), or a custom <Target> with <Copy> to move a referenced project's output. It also covers a heavy third-party SDK reference added to a unit test project when a simple mock can reproduce the behaviour.
Evidence:
#9535correction: "I don't think we should add a reference to this to our tests - it's a very heavy dependency, and ultimately we can simulate the same behaviour with a simple mock."
The defect is the one PERF-2.2 targets: building the whole structure just to read part of it.
Why is this bad? The defect is the one PERF-2.2 targets: building the whole structure just to read part of it. Here it is a native WAF map instead of JSON, so the current Flag line does not catch it.
Current:
reading a response body into a string, or parsing into JToken/JObject, before extracting the part you need.
Proposed:
reading a response body into a string, or parsing into JToken/JObject, before extracting the part you need. Also flag decoding a whole native or serialized object, such as a WAF diagnostics map with DecodeMap(), to read a few fields. Also flag decoding the same object twice.
Evidence:
#9481correction: "DecodeMap() materializes the whole diagnostic object, including every loaded rule ID and the warnings, just to read the error/errors fields."
PERF-3.6
Performance
new rule: Set typed tag properties directly and use SetTag only as a fallback
Routing every tag through the SetTag key lookup on a span-tagging hot path was corrected back to direct property assignment.
Why is this bad? Routing every tag through the SetTag key lookup on a span-tagging hot path was corrected back to direct property assignment. PERF-3.1 only covers deferring computed SetTag work to the serializer.
Proposed rule:
PERF-3.6: Set typed tag properties directly and use SetTag only as a fallback
Flag: SetTag(key, value) that writes a tag the concrete tags class (for example, AzureFunctionsTags) exposes as a typed property.
❌ rootSpan.SetTag(key, value); // for every tag, even when Tags is AzureFunctionsTags
✅ if (rootSpan.Tags is AzureFunctionsTags tags) { /* set properties */ } else { rootSpan.SetTag(key, value); }
Evidence:
#9479correction: "For performance, try to set properties directly when possible, and only use SetTag() as a fallback (like the original code)."
PERF-3.7
Performance
new rule: Keep shared writes off the steady-state per-request path
Two writes per exposure on one cache line shared by all request threads caused contention in healthy apps.
Why is this bad? Two writes per exposure on one cache line shared by all request threads caused contention in healthy apps. PERF-5.1 is limited to Dynamic Instrumentation, and the Don't flag item only covers uncontended locks.
Proposed rule:
PERF-3.7: Keep shared writes off the steady-state per-request path
Flag: a shared counter that all request threads write on every request or exposure. If one event settles its check, stop writing after it.
✅ stop updating the shared counter after the first commit, so the steady state writes nothing.
Evidence:
#9644correction: "That puts two writes per exposure on one cache line shared by all request threads."
SEC-2.4
Security-And-Safety
new rule: Fetch CI config and helper repositories at the pipeline commit SHA, not a branch name
No rule covers fetching CI config from a mutable branch ref.
Why is this bad? No rule covers fetching CI config from a mutable branch ref. SEC-2.1 and SEC-2.3 only cover actions and images. The Windows benchmark bootstrap cloned by branch name and was fixed to fetch CI_COMMIT_SHA.
Proposed rule:
SEC-2.4: Fetch CI config and helper repositories at the pipeline commit SHA, not a branch name
Flag: a CI script that clones or checks out a repository by branch name (git clone -b $CI_COMMIT_REF_NAME). It must use the pipeline commit (CI_COMMIT_SHA) instead. A branch can move or disappear. The job then runs config that does not match the pipeline commit.
no general defect: no general defect: Mixing seconds with milliseconds and truncating each interval before summing are two different defects that only share the topic of time.
Why is this bad? A seconds and milliseconds mix-up gave latencies of about 57 years. Truncating each WAF run to whole microseconds undercounted the totals.
Proposed rule:
COR-5.6: Convert time values to one unit before arithmetic, and truncate only the final total
Flag: arithmetic that mixes time values of different units, such as AMQP seconds and a millisecond clock. Also flag a duration truncated to a coarser unit before it joins a running total.
fires on fixed code: the rule also fired on the fixed code of #9663
Why is this bad? The coverage probe rethrew into customer finalizers and type initializers, which can crash the process. No rule covers this.
Proposed rule:
COR-5.10: Never throw from injected probe code into customer code
Flag: injected instrumentation, such as the coverage probe GetFileCounter, that throws or rethrows a failure into customer code. This code can run inside customer finalizers and type initializers. Mark the data incomplete and continue instead.
duplicate: the same defect as COR-3.3:new_rule:rule: The script hint shows that the Correctness change uses the same PR 9514 lesson about this precedence, so it is most...
Why is this bad? The agreed cross-SDK precedence is that explicit DD_* configuration wins over the OTEL_* equivalent. No rule in any lens states it.
Proposed rule:
XSDK-1.3: Apply an OTEL_* value only when the matching DD_* key is absent
Flag: code where an OTEL_* setting overrides a DD_* setting that the user set explicitly.
❌ OTEL_SDK_DISABLED=true turns tracing off even when DD_TRACE_ENABLED=true is set.
✅ OTEL_SDK_DISABLED applies only when DD_TRACE_ENABLED is not present.
Evidence:
#9514correction: "I think we may want to update this check to only override if the DD configuration is not present."
no general defect: no general defect: One lesson is about too many separate time seams, and the other is about delegate allocations in tracer code; these are different defects ...
Why is this bad? In two PRs, authors added time seams as several ad hoc delegates and Stopwatch parameters. Reviewers asked for one abstraction: an ITimeProvider, or a generic struct host interface to avoid delegate allocations. No rule covers the shape of test seams.
Proposed rule:
DES-3.9: Inject time through one abstraction
Flag: a component takes several test seams for time. Examples are a Stopwatch, an elapsed Func, and a sleep delegate. Use one interface such as ITimeProvider. If the seam is in tracer code, use a generic struct host interface instead of delegates.
❌ A reader that takes a Stopwatch, an elapsed Func, and a waitForRetry delegate.
✅ A reader that takes one ITimeProvider.
Evidence:
#9697correction: "Do you really need a stopwatch and an elapsedProvider, and a waitForRetry?"
#9568correction: "Using delegates for this add a few additional heap allocations and a bit of overhead for the delegate invocation."
no general defect: no general defect: The shared pattern (reimplementing logic an existing helper already provides) is already what MAINT-1.1 says, so the sharpening only adds ...
Why is this bad? Several PRs reimplemented existing helpers (URL cleaning, service normalization, header reads, OTLP resolution) that the current Flag list does not name, so reviewers missed them.
Current:
a new method or loop that encodes varints, parses/formats hex, builds random names, or re-derives an existing settings check by hand.
Proposed:
a new method or loop that encodes varints, parses/formats hex, builds random names, or re-derives an existing settings check by hand. It also covers hand-rolled URL redaction instead of UriHelpers.CleanUri, and service normalization instead of NormalizerTraceProcessor.NormalizeService. It also covers a new header helper on one transport instead of IApiResponse.GetHeader. If a new OTLP signal is added, it must resolve its endpoint through ExporterSettings.GetOtlpTransport.
Evidence:
#9650correction: "This is what UriHelpers.CleanUri(uri, removeScheme: false, tryRemoveIds: false) already does: scheme, host, port and path, minus user-info, query and fragment."
#9687correction: "Normalization code is not specific to FeatureFlags, and can change, as you've seen."
no general defect: no general defect: The lessons cover different defects (mutex exception handling, the configuration-source empty-value rule, csproj version drift), and the t...
Why is this bad? Fixes were applied to one sibling only: AbandonedMutexException handling in the reader only, the empty OTEL rule in one config source only, and a Mono.Cecil bump in some projects only.
Current:
an extra setting, retry or call added next to one use of a helper/command (or in one of several near-identical files) when every other use needs it too.
Proposed:
an extra setting, retry or call added next to one use of a helper/command (or in one of several near-identical files) when every other use needs it too. This also covers exception handling added around one call to a shared resource, such as one WaitOne call. It also covers a package version bumped in some csproj files but not the others. If a rule applies to every configuration source, put it in the shared source type.
#9497correction: "I'm not sure this is the right place to do that, unless you don't want to include other configuration sources, but I don't see why you wouldn't 🤔 Today the same OTEL setting behaves differently depending on where it's set."
#9761correction: "I think you should update this everywhere, to keep things in sync."
no general defect: no general defect: One lesson is a logger that is still used sometimes but always created, and the other is a metadata stamp removed mainly because its advis...
Why is this bad? A static logger created but mostly unused and a metadata stamp with no reader were removed in review, but the Flag only names fields nothing reads.
Current:
a constant/field nothing reads, a type implementing IDisposable with an empty Dispose(), or Debug.WriteLine in a catch block (compiled out of release builds).
Proposed:
a constant/field nothing reads, a type implementing IDisposable with an empty Dispose(), or Debug.WriteLine in a catch block (compiled out of release builds). It also covers a value that code writes but nothing reads, such as a metadata key with no reader. It also covers a static default logger that the type always creates but an injected logger replaces.
Evidence:
#9465correction: "Just noticed, you should remove the static readonly IDatadogLogger Log field entirely - currently you're always creating it, and then only sometimes using it."
#9644correction: "Here the stamp has no reader inside the SDK."
🧭 15 lessons that no lens took. A lens sent each one to another lens, and none used it. A person can place them.
#9403absence: When the profiler's SSI delayed start was added, cleanup of event-based services (EventPipe/ETW communication) on a failed delayed start was missing
#9445correction: Tracer configuration system: a new setting read directly from an environment variable instead of through TracerSettings/ConfigurationKeys and supported-confi...
#9456miss: Kinesis sync GetRecords call-target integration did not pass the stream name into CallTargetState, so DSM consume checkpoints were never recorded
#9479correction: TestingOnly analyzer: an internal overload and a parameterless constructor that exist only for tests lacked [TestingOnly] or [TestingOnlyAndPrivate], so the ...
#9479correction: Tag source-generator tests: a test of which tags reach the wire checked ToString() output, which is the debug path, instead of EnumerateTags, which feeds ser...
#9481correction: AppSec WAF config_errors telemetry tests: they missed the partial-load case, where init succeeds but some rules are rejected, and never asserted a count abov...
#9515correction: TracerSettingsTests expected-metrics helper for OTEL_PROPAGATORS hardcoded case-specific logic instead of mirroring the input-agnostic logic of TracerSetting...
#9596correction: OTLP trace export: the resource was written only for the first trace chunk in a payload, so later chunks with a different env, version or service were report...
#9600correction: The RaspMetricsHelper running-total test only used increasing totals, so it could not catch a regression in the keep-the-latest (Math.Max) logic.
#9625disagreement: The Nuke _build project keeps `new[] { ...
5 more are in the run report.
5 defects that a rule already describes
COR-6.1 · Correctness: The Flag already names [TracerRestorer] and the global tracer where a local instance would do. #9455
COR-3.2 · Correctness: OTEL_SDK_DISABLED forced metrics off, but runtime metrics still contradicted it. #9514
COR-6.4 · Correctness: The existing Not when already allows a time bound that checks bounded or blocking behaviour, if a comment explains it. #9695
MAINT-1.3 · Maintainability: Adding AddTruncation at call sites instead of inside CheckWAFError is exactly a call added next to one use of a helper. #9711
How to answer, and run details
How to answer each change
Nothing, ok, LGTM or a thumbs up: keep the change.
discard or discard: <reason>: put the rule back as it is on main. Outside a review thread, name the rule: discard LIFE-005.
A suggestion block: replace those lines.
add <ID>: apply a folded change, for example one with evidence from one PR only. When a rule has two changes, name one: add LIFE-005#2.
Any other comment on a rule: an agent edits that rule as you ask.
A change goes into the diff when its evidence comes from 2 or more distinct PRs. Each change must also pass the evidence thresholds and lint.
If the reason of a discard holds for the future, write it in the rule, for example as Not when:. The next runs read the rules.
This PR only edits docs/development/for-ai/Coding-Requirements/. It never merges by itself: a maintainer of this repository approves it. The next monthly run publishes nothing while it is open.
Not applied
Rule
Action
Status
Reason
COR-5.3
add_not_when
not_enough_evidence
needs two PRs or a written decision
COR-5.8
new_rule
not_enough_evidence
needs a fix, an applied maintainer correction, or two PRs
DES-1.2
sharpen
not_enough_evidence
needs a fix, an applied maintainer correction, or two PRs
SEC-2.3
sharpen
not_enough_evidence
needs a fix, an applied maintainer correction, or two PRs
Human-only review and outside context: never rule material.
#9449human_only: Profiler integration tests marked Flaky as a workaround while a real profiler bug (bad stack frame output) may be the cause
#9528context: Build-toolchain Dockerfile changes need republished images and rebuilt CI VMs (prebaked outside the repo) before taking effect; the PR was merged without that coordination and a revert was opened.
#9599human_only: Unit tests kept a reimplementation of the old matcher as a differential/equivalence reference, with heavy randomized setup. The reviewer questioned its value, and the author removed it.
#9642context: New telemetry metrics must be registered in the dd-go telemetry intake, outside this repository, before the tracer sends them. Until then the intake drops them.
#9664context: OpenTelemetry metrics periodic exporting MetricReader: the external OTel SDK spec allows delaying or skipping collection while an export is in progress
#9669human_only: AgentWriter normalization unit tests (test framework): a heavily parameterized test with large setup is hard to read and unclear about what it verifies.
Coverage: Correctness 20 · Security-And-Safety 4 · Design 11 · Performance 6 · Maintainability 7 · Codebase-Conventions (no output) · Cross-SDK-Consistency 7. 40 candidates went to another lens. 1 candidates had a quote that does not match.
Found 0 performance improvements and 0 performance regressions! Performance is the same for 18 metrics, 0 unstable metrics, 4 known flaky benchmarks, 139 flaky benchmarks without significant changes.
Explanation
This is an A/B test comparing a candidate commit's performance against that of a baseline commit. Performance changes are noted in the tables below as:
🟩 = significantly better candidate vs. baseline
🟥 = significantly worse candidate vs. baseline
We compute a confidence interval (CI) over the relative difference of means between metrics from the candidate and baseline commits, considering the baseline as the reference.
If the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD), the change is considered significant.
Feel free to reach out to #apm-benchmarking-platform on Slack if you have any questions.
More details about the CI and significant changes
You can imagine this CI as a range of values that is likely to contain the true difference of means between the candidate and baseline commits.
CIs of the difference of means are often centered around 0%, because often changes are not that big:
---------------------------------(------|---^--------)-------------------------------->
-0.6% 0% 0.3% +1.2%
| | |
lower bound of the CI --' | |
sample mean (center of the CI) -------------' |
upper bound of the CI ----------------------'
As described above, a change is considered significant if the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD).
For instance, for an execution time metric, this confidence interval indicates a significantly worse performance:
----------------------------------------|---------|---(---------^---------)---------->
0% 1% 1.3% 2.2% 3.1%
| | | |
significant impact threshold --------------' | | |
lower bound of CI --------------' | |
sample mean (center of the CI) --------------------------' |
upper bound of CI ----------------------------------'
Known flaky benchmarks
These benchmarks are marked as flaky and will not trigger a failure. Modify FLAKY_BENCHMARKS_REGEX to control which benchmarks are marked as flaky.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note
Monthly review learning. 2 changes to the code review rules, learned from the 212 PRs merged from 2026-10-27 to 2026-11-25.
Review them in Files changed, and answer on each rule:
ok,discard, a suggestion, or a comment. Once a day, a workflow applies the answers and replies.More changes stayed out of this PR. They are in the folded sections below. Open a row for what the rule does, why, the examples and the evidence. If one is worth it, comment
add <ID>: the workflow adds it to this PR.The changes with evidence from one PR only, or over the limit, are kept. If the next months bring more evidence, they can come back in a later PR, with no action from you.
🆕 New rules (1)
Rules that the review does not have yet. Open the last cell of a row for what it does, why, a bad and a good example, and the evidence.
COR-5.5Two PRs duplicated a path part by appending it without a check: the Front Door proxy path and the OTLP signal path.
What it does: code that always prepends
/or appends a path segment such asv1/<signal>to a configured or header value. If the value already has it, the result is//pathor/v1/logs/v1/logs.Why is this bad? Two PRs duplicated a path part by appending it without a check: the Front Door proxy path and the OTLP signal path.
Tested examples
❌ Bad code from #8861: the review caught it with
COR-5.5.❌ Bad code from #9505: the review caught it with
COR-5.5.Evidence:
correction: "It would also be helpful to link the Front Door rule configuration that guarantees the header uses {url_path}. e.g. this is set headers.Set(InferredProxyHeaders.Path, "/api/test"); Additionally, it may be best to conditionally add the/if we see it missing we add it if we see it there we skip it."correction: "Edge case for logs: ifOTEL_EXPORTER_OTLP_ENDPOINTalready ends with the signal path, e.g.http://c:4318/v1/logswith an HTTP logs protocol, this appends it again and we send tohttp://c:4318/v1/logs/v1/logs, so the collector returns 404."🔧 Existing rules, tuned (1)
Rules that exist, with a new case, a new exception, or better words. The Change column says which. Open the last cell of a row for the details.
COR-6.1Reviewers flagged tests that changed global state with only a restorer attribute and no non-parallel collection.
What it does: unit tests using a
SomeType.Instancesingleton,[TracerRestorer]/SetTracer, orTracer.Instancewhere a locally constructed instance would do, or aReset()/Clear()added to production state only so tests can reuse it. If a test changes process-wide static state such asTracer.InstanceorBaggage.Current, its class must be in a non-parallel test collection. A restorer attribute alone does not stop the race.Why is this bad? Reviewers flagged tests that changed global state with only a restorer attribute and no non-parallel collection. The current Flag does not cover that case.
Tested examples
❌ Bad code from #9479: the review caught it with
COR-6.1.❌ Bad code from #9529: the review caught it with
COR-6.1.Evidence:
correction: "🟠 HIGH · SDK P2 · COR-6.1: Attracer/test/Datadog.Trace.Tests/ClrProfiler/AutoInstrumentation/Azure/Functions/AzureFunctionsCommonTests.cs:154, this test publishes its tracer process-wide, but the class is not in a nonparallel collection.[TracerRestorer]restores the previous tracer afterward; it does not synchronize concurrent tests."correction: "Adding this attribute alone isn't sufficient - you'll have to put it (and any tests that use it) in a collection to disable parallel execution too."Out of this PR
🧑⚖️ 12 changes need your decision. The judge or the replay could not check them. Comment
add <ID>to bring one into this PR.COR-1.1A stub declared
string[]while the integration that replaces it usedstring?[]?.Why is this bad? A stub declared
string[]while the integration that replaces it usedstring?[]?. That is a nullability mismatch the current Flag does not name.Current:
Proposed:
Evidence:
correction: "This signature does not match your original."COR-5.1Whitespace-only OTEL values counted as set and were then trimmed to empty, so the fallback was skipped.
Why is this bad? Whitespace-only OTEL values counted as set and were then trimmed to empty, so the fallback was skipped. The rule only names the empty string.
Current:
Proposed:
Evidence:
correction: "What about a string with only spaces?"COR-2.5Three PRs had check-then-act races: an isFirst check, a log-once flag, and a File.Exists-then-open.
Why is this bad? Three PRs had check-then-act races: an isFirst check, a log-once flag, and a File.Exists-then-open. The existing concurrency rules cover field visibility, CompareExchange results, and dispose checks, but not this general race.
Proposed rule:
Evidence:
correction: "There's a race here I think. If you have two configurations being applied at once, you could callisFirston the wrong one."correction: "looks like anInterlocked.CompareExchangein disguise, no ?if (Interlocked.CompareExchange(ref _longNameLogged, 1, 0) == 0)"correction: "Failure mode: The new File.Exists()-then-open sequence allows concurrent launches to select the same loader.conf path."COR-2.6AbandonedMutexExceptionat every wait on a shared mutexOnly the CircularChannel reader handled abandoned mutexes.
Why is this bad? Only the CircularChannel reader handled abandoned mutexes. The constructor and writer kept the lock, and other processes timed out.
Proposed rule:
Evidence:
absence(culprit #9192)COR-2.7ReportWafRequests depended on callers to hold the lock, and nothing enforced it.
Why is this bad? ReportWafRequests depended on callers to hold the lock, and nothing enforced it. No rule covers this lock precondition.
Proposed rule:
Evidence:
correction: "AFAICT, there's nothing that enforces this, which seems like a potential issue..."COR-3.3OTEL_*setting only when the matchingDD_*setting is absentAn OTEL setting overrode an explicit DD setting in MutableSettings and TracerSettings.
Why is this bad? An OTEL setting overrode an explicit DD setting in MutableSettings and TracerSettings. No rule defines this precedence.
Proposed rule:
Evidence:
correction: "I think we may want to update this check to only override if the DD configuration is not present."COR-5.7In Kafka and Hangfire consumers, baggage leaked between messages and into batch processing.
Why is this bad? In Kafka and Hangfire consumers, baggage leaked between messages and into batch processing. No rule covers restoring ambient state.
Proposed rule:
Evidence:
absence(culprit #7543)correction: "IIUC, for the "batch" case (which is one of the most common approaches), this leaves the baggage item for the "last" message as the ambient baggage."COR-5.11WAF subcontexts leaked when OnDownstreamRequest threw.
Why is this bad? WAF subcontexts leaked when OnDownstreamRequest threw. COR-5.2 covers stream ownership only.
Proposed rule:
Evidence:
correction: "Are we guaranteed to always callCloseSubcontext? Even in case of exceptions etc?"COR-5.12A failed GetCustomAttributesData read turned off failure protection, so quarantine could hide a critical failure.
Why is this bad? A failed GetCustomAttributesData read turned off failure protection, so quarantine could hide a critical failure.
Proposed rule:
Evidence:
correction: "This should be rare. Fix: on a read error, retry another way or treat the state as unknown, so that it doesn't enable suppression."XSDK-1.2supported-configurations.yamlwhen a key's behaviour changesThe configuration registry shared across SDKs tracks behaviour through implementation versions.
Why is this bad? The configuration registry shared across SDKs tracks behaviour through implementation versions. No rule asks for a bump when the semantics of a key change.
Proposed rule:
Evidence:
correction: "Do we need a new implementation version that indicates we disable traces, logs, and metrics?"PERF-3.2PERF-3.2 covers argument work in Log.Debug only.
Why is this bad? PERF-3.2 covers argument work in Log.Debug only. The evidence shows an unguarded Log.Warning that allocates an object[] for more than three arguments, and a costly logging helper that left the level check to its callers.
Current:
Proposed:
Evidence:
correction: "Thenew object[]below is guarded withif (Log.IsEnabled(LogEventLevel.Debug)), but this one isn't, so we pay the price for thisnew object[]allocation even if "warning" logs are disabled (for example if log level is "error")."correction: "I would be inclined to move the debug logging enabled check inside this method, given it's so expensive if you get it wrong, but you wouldn't know you got it wrong, because you still wouldn't have a log 😅"PERF-2.6A reviewer pointed out that delegate-based test seams add heap allocations and delegate-call overhead.
Why is this bad? A reviewer pointed out that delegate-based test seams add heap allocations and delegate-call overhead. The author switched to the struct host interface that the repo prefers. No rule in any lens covers this.
Proposed rule:
Evidence:
correction: "Using delegates for this add a few additional heap allocations and a bit of overhead for the delegate invocation."1️⃣ 13 changes with evidence from one PR only. They wait for more evidence in the next months. Comment
add <ID>to bring one into this PR.COR-1.3is { } x, notis var x, to check for nullRemoting integrations used
is varas a null guard and dereferenced a null scope.Why is this bad? Remoting integrations used
is varas a null guard and dereferenced a null scope. No rule names this pattern.Proposed rule:
Evidence:
miss(culprit #4829)COR-5.9CallTargetBubbleUpExceptionfrom CallTarget continuation catch blocksContinuation generators swallowed AppSec blocks and lost task results.
Why is this bad? Continuation generators swallowed AppSec blocks and lost task results. COR-5.4 covers a different OnMethodEnd interaction.
Proposed rule:
Evidence:
absence(culprit #5393)XSDK-3.2The OTLP schema requires unique attribute keys, and a consumer that keeps the last value loses data.
Why is this bad? The OTLP schema requires unique attribute keys, and a consumer that keeps the last value loses data. No existing rule covers this spec contract.
Proposed rule:
Evidence:
correction: "The OTLP schema requires unique attribute keys, and a consumer that keeps the last value would lose the security report."XSDK-3.3The sampling decision maker and priority values are a cross-SDK and backend contract.
Why is this bad? The sampling decision maker and priority values are a cross-SDK and backend contract. Emulating defaults with a user rate misattributes the ingestion reason and drops traces.
Proposed rule:
Evidence:
absence(culprit #9498)DES-3.6Azure Container Apps detection was added to TracerSettings although it is not a setting.
Why is this bad? Azure Container Apps detection was added to TracerSettings although it is not a setting. The reviewer moved it to AzureInfo. The current Flag does not name environment detection or TracerSettings.
Current:
Proposed:
Evidence:
correction: "This should probably live inDatadog.Trace.Serverless.AzureInfosince it's not actually a tracer setting."DES-3.8Two PRs relied on callers to do a required step before an API call: a debug-level check before expensive logging, and a lock before ReportWafRequests.
Why is this bad? Two PRs relied on callers to do a required step before an API call: a debug-level check before expensive logging, and a lock before ReportWafRequests. The reviewers moved the step into the method. No rule covers this API shape.
Proposed rule:
Evidence:
correction: "I would be inclined to move the debug logging enabled check inside this method, given it's so expensive if you get it wrong, but you wouldn't know you got it wrong, because you still wouldn't have a log 😅"correction: "AFAICT, there's nothing that enforces this, which seems like a potential issue..."DES-6.4When the build gained a prerelease-aware FullVersion, the Linux artifact names and the consuming docker action kept the 3-part Version.
Why is this bad? When the build gained a prerelease-aware FullVersion, the Linux artifact names and the consuming docker action kept the 3-part Version. As a result, prerelease and release packages looked the same. No build rule covers this.
Proposed rule:
Evidence:
absence(culprit #9521)DES-6.5The libunwind ExternalProject kept a prefix that did not depend on the pin and had updates disabled.
Why is this bad? The libunwind ExternalProject kept a prefix that did not depend on the pin and had updates disabled. A reused build folder could therefore build the profiler with a stale dependency. No rule covers this.
Proposed rule:
Evidence:
miss(culprit #9786)MAINT-5.1Datadog.Trace.Tests took a Microsoft.Azure.Cosmos reference to reproduce disposal behaviour, and the author replaced it with a mock.
Why is this bad? Datadog.Trace.Tests took a Microsoft.Azure.Cosmos reference to reproduce disposal behaviour, and the author replaced it with a mock.
Current:
Proposed:
Evidence:
correction: "I don't think we should add a reference to this to our tests - it's a very heavy dependency, and ultimately we can simulate the same behaviour with a simple mock."PERF-2.2The defect is the one PERF-2.2 targets: building the whole structure just to read part of it.
Why is this bad? The defect is the one PERF-2.2 targets: building the whole structure just to read part of it. Here it is a native WAF map instead of JSON, so the current Flag line does not catch it.
Current:
Proposed:
Evidence:
correction: "DecodeMap()materializes the whole diagnostic object, including every loaded rule ID and the warnings, just to read theerror/errorsfields."PERF-3.6SetTagonly as a fallbackRouting every tag through the SetTag key lookup on a span-tagging hot path was corrected back to direct property assignment.
Why is this bad? Routing every tag through the SetTag key lookup on a span-tagging hot path was corrected back to direct property assignment. PERF-3.1 only covers deferring computed SetTag work to the serializer.
Proposed rule:
Evidence:
correction: "For performance, try to set properties directly when possible, and only useSetTag()as a fallback (like the original code)."PERF-3.7Two writes per exposure on one cache line shared by all request threads caused contention in healthy apps.
Why is this bad? Two writes per exposure on one cache line shared by all request threads caused contention in healthy apps. PERF-5.1 is limited to Dynamic Instrumentation, and the Don't flag item only covers uncontended locks.
Proposed rule:
Evidence:
correction: "That puts two writes per exposure on one cache line shared by all request threads."SEC-2.4No rule covers fetching CI config from a mutable branch ref.
Why is this bad? No rule covers fetching CI config from a mutable branch ref. SEC-2.1 and SEC-2.3 only cover actions and images. The Windows benchmark bootstrap cloned by branch name and was fixed to fetch CI_COMMIT_SHA.
Proposed rule:
Evidence:
miss(culprit #8300)🚫 7 changes left out by the judge or the replay. Each row says why. Comment
add <ID>to bring one into this PR.COR-5.6no general defect: no general defect: Mixing seconds with milliseconds and truncating each interval before summing are two different defects that only share the topic of time.
Why is this bad? A seconds and milliseconds mix-up gave latencies of about 57 years. Truncating each WAF run to whole microseconds undercounted the totals.
Proposed rule:
Evidence:
miss(culprit #4520)correction: "Casting each elapsed interval toulonghere discards its fractional microsecond before it reaches either request total."COR-5.10fires on fixed code: the rule also fired on the fixed code of #9663
Why is this bad? The coverage probe rethrew into customer finalizers and type initializers, which can crash the process. No rule covers this.
Proposed rule:
Evidence:
miss(culprit #8926)XSDK-1.3OTEL_*value only when the matchingDD_*key is absentduplicate: the same defect as COR-3.3:new_rule:rule: The script hint shows that the Correctness change uses the same PR 9514 lesson about this precedence, so it is most...
Why is this bad? The agreed cross-SDK precedence is that explicit DD_* configuration wins over the OTEL_* equivalent. No rule in any lens states it.
Proposed rule:
Evidence:
correction: "I think we may want to update this check to only override if the DD configuration is not present."DES-3.9no general defect: no general defect: One lesson is about too many separate time seams, and the other is about delegate allocations in tracer code; these are different defects ...
Why is this bad? In two PRs, authors added time seams as several ad hoc delegates and Stopwatch parameters. Reviewers asked for one abstraction: an ITimeProvider, or a generic struct host interface to avoid delegate allocations. No rule covers the shape of test seams.
Proposed rule:
Evidence:
correction: "Do you really need a stopwatch and an elapsedProvider, and awaitForRetry?"correction: "Using delegates for this add a few additional heap allocations and a bit of overhead for the delegate invocation."MAINT-1.1no general defect: no general defect: The shared pattern (reimplementing logic an existing helper already provides) is already what MAINT-1.1 says, so the sharpening only adds ...
Why is this bad? Several PRs reimplemented existing helpers (URL cleaning, service normalization, header reads, OTLP resolution) that the current Flag list does not name, so reviewers missed them.
Current:
Proposed:
Evidence:
correction: "This is whatUriHelpers.CleanUri(uri, removeScheme: false, tryRemoveIds: false)already does: scheme, host, port and path, minus user-info, query and fragment."correction: "Normalization code is not specific to FeatureFlags, and can change, as you've seen."correction: "which forces an allocation"absence(culprit #7680)MAINT-1.3no general defect: no general defect: The lessons cover different defects (mutex exception handling, the configuration-source empty-value rule, csproj version drift), and the t...
Why is this bad? Fixes were applied to one sibling only: AbandonedMutexException handling in the reader only, the empty OTEL rule in one config source only, and a Mono.Cecil bump in some projects only.
Current:
Proposed:
Evidence:
absence(culprit #9192)correction: "I'm not sure this is the right place to do that, unless you don't want to include other configuration sources, but I don't see why you wouldn't 🤔 Today the same OTEL setting behaves differently depending on where it's set."correction: "I think you should update this everywhere, to keep things in sync."MAINT-2.1no general defect: no general defect: One lesson is a logger that is still used sometimes but always created, and the other is a metadata stamp removed mainly because its advis...
Why is this bad? A static logger created but mostly unused and a metadata stamp with no reader were removed in review, but the Flag only names fields nothing reads.
Current:
Proposed:
Evidence:
correction: "Just noticed, you should remove thestatic readonly IDatadogLogger Logfield entirely - currently you're always creating it, and then only sometimes using it."correction: "Here the stamp has no reader inside the SDK."🧭 15 lessons that no lens took. A lens sent each one to another lens, and none used it. A person can place them.
absence: When the profiler's SSI delayed start was added, cleanup of event-based services (EventPipe/ETW communication) on a failed delayed start was missingcorrection: Tracer configuration system: a new setting read directly from an environment variable instead of through TracerSettings/ConfigurationKeys and supported-confi...miss: Kinesis sync GetRecords call-target integration did not pass the stream name into CallTargetState, so DSM consume checkpoints were never recordedcorrection: TestingOnly analyzer: an internal overload and a parameterless constructor that exist only for tests lacked [TestingOnly] or [TestingOnlyAndPrivate], so the ...correction: Tag source-generator tests: a test of which tags reach the wire checked ToString() output, which is the debug path, instead of EnumerateTags, which feeds ser...correction: AppSec WAF config_errors telemetry tests: they missed the partial-load case, where init succeeds but some rules are rejected, and never asserted a count abov...correction: TracerSettingsTests expected-metrics helper for OTEL_PROPAGATORS hardcoded case-specific logic instead of mirroring the input-agnostic logic of TracerSetting...correction: OTLP trace export: the resource was written only for the first trace chunk in a payload, so later chunks with a different env, version or service were report...correction: The RaspMetricsHelper running-total test only used increasing totals, so it could not catch a regression in the keep-the-latest (Math.Max) logic.disagreement: The Nuke _build project keeps `new[] { ...5 more are in the run report.
5 defects that a rule already describes
COR-6.1· Correctness: The Flag already names[TracerRestorer]and the global tracer where a local instance would do. #9455COR-3.2· Correctness:OTEL_SDK_DISABLEDforced metrics off, but runtime metrics still contradicted it. #9514COR-6.4· Correctness: The existing Not when already allows a time bound that checks bounded or blocking behaviour, if a comment explains it. #9695DES-1.1· Design: TracerSettings re-read DD_APPSEC_ENABLED, which SecuritySettings already owns. #9721MAINT-1.3· Maintainability: Adding AddTruncation at call sites instead of inside CheckWAFError is exactly a call added next to one use of a helper. #9711How to answer, and run details
How to answer each change
ok,LGTMor a thumbs up: keep the change.discardordiscard: <reason>: put the rule back as it is onmain. Outside a review thread, name the rule:discard LIFE-005.add <ID>: apply a folded change, for example one with evidence from one PR only. When a rule has two changes, name one:add LIFE-005#2.Not when:. The next runs read the rules.This PR only edits
docs/development/for-ai/Coding-Requirements/. It never merges by itself: a maintainer of this repository approves it. The next monthly run publishes nothing while it is open.Not applied
COR-5.3COR-5.8DES-1.2SEC-2.3Human-only review and outside context: never rule material.
human_only: Profiler integration tests marked Flaky as a workaround while a real profiler bug (bad stack frame output) may be the causecontext: Build-toolchain Dockerfile changes need republished images and rebuilt CI VMs (prebaked outside the repo) before taking effect; the PR was merged without that coordination and a revert was opened.human_only: Unit tests kept a reimplementation of the old matcher as a differential/equivalence reference, with heavy randomized setup. The reviewer questioned its value, and the author removed it.context: New telemetry metrics must be registered in the dd-go telemetry intake, outside this repository, before the tracer sends them. Until then the intake drops them.context: OpenTelemetry metrics periodic exporting MetricReader: the external OTel SDK spec allows delaying or skipping collection while an export is in progresshuman_only: AgentWriter normalization unit tests (test framework): a heavily parameterized test with large setup is hard to read and unclear about what it verifies.Coverage: Correctness 20 · Security-And-Safety 4 · Design 11 · Performance 6 · Maintainability 7 · Codebase-Conventions (no output) · Cross-SDK-Consistency 7. 40 candidates went to another lens. 1 candidates had a quote that does not match.
Run: the workflow run in Datadog.