Add DD_DYNAMIC_INSTRUMENTATION_CAPTURE_TIMEOUT environment variable#5386
Add DD_DYNAMIC_INSTRUMENTATION_CAPTURE_TIMEOUT environment variable#5386
Conversation
|
👋 Hey @p-datadog, please fill "Change log entry" section in the pull request description. If changes need to be present in CHANGELOG.md you can state it this way **Change log entry**
Yes. A brief summary to be placed into the CHANGELOG.md(possible answers Yes/Yep/Yeah) Or you can opt out like that **Change log entry**
None.(possible answers No/Nope/None) Visited at: 2026-02-20 22:20:28 UTC |
BenchmarksBenchmark execution time: 2026-02-20 22:49:46 Comparing candidate commit 502346c in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 44 metrics, 2 unstable metrics.
|
What does this PR do?
Adds environment variable support for the Dynamic Instrumentation circuit breaker's
max_processing_timeconfiguration using the cross-language standardDD_DYNAMIC_INSTRUMENTATION_CAPTURE_TIMEOUTenvironment variable.Motivation:
The circuit breaker's
max_processing_timethreshold was only configurable programmatically viac.dynamic_instrumentation.internal.max_processing_time, which created challenges for system testing:0to force immediate probe disabling for testingThis PR adds environment variable support with:
DD_DYNAMIC_INSTRUMENTATION_CAPTURE_TIMEOUT(matching Java) for easy discoverability by multi-language teams200) and converts to seconds internally (0.2)Change log entry
N/A - This is an internal-only configuration change. The
max_processing_timesetting is underc.dynamic_instrumentation.internal.*namespace, which is explicitly documented as "for internal Datadog use only" in the configuration file. No customer-facing documentation or release notes entry is needed.Additional Notes:
Cross-language alignment:
DD_DYNAMIC_INSTRUMENTATION_CAPTURE_TIMEOUT=100(100ms, version A, tracks snapshot capture only)DD_DYNAMIC_INSTRUMENTATION_CAPTURE_TIMEOUT=200(200ms, version B, tracks full DI processing time: entry + exit)DD_DYNAMIC_INSTRUMENTATION_CAPTURE_TIMEOUT_MS=15(15ms, different suffix pattern)Ruby reuses Java's environment variable name for consistency, even though the implementation semantics differ slightly (Ruby tracks full processing time vs Java tracking just capture).
Configuration versioning:
Ruby uses version B in
supported-configurations.jsonbecause the default value differs from Java's version A (200ms vs 100ms). Ruby, being a slower language, likely needs a higher timeout in practice to provide the same bounding behavior as Java. This cross-language versioning is documented indocs/AccessEnvironmentVariables.md.Environment variable behavior:
""→nil(circuit breaker disabled)-1,-999) →nil(circuit breaker disabled)"0"→0.0(trips immediately after first execution)"200") → converted to seconds (0.2)0.2seconds (200ms default)The custom
env_parserhandles:nilinstead of0.0(Ruby's defaultString#to_fbehavior)nilfor convenient disablingDefault value rationale:
How to test the change?
Unit tests were added covering:
Related:
lib/datadog/di/instrumenter.rb:586-597lib/datadog/di/configuration/settings.rb:228-251