Skip to content

Exclude OTLP header and Datadog key configs from telemetry#3961

Draft
bm1549 wants to merge 1 commit into
masterfrom
brian.marks/omit-sensitive-config-telemetry
Draft

Exclude OTLP header and Datadog key configs from telemetry#3961
bm1549 wants to merge 1 commit into
masterfrom
brian.marks/omit-sensitive-config-telemetry

Conversation

@bm1549

@bm1549 bm1549 commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

Description

Excludes the OTLP exporter header configurations (OTEL_EXPORTER_OTLP_HEADERS, OTEL_EXPORTER_OTLP_METRICS_HEADERS, OTEL_EXPORTER_OTLP_LOGS_HEADERS) and DD_API_KEY from configuration telemetry, via a sensitive flag on the configuration entry. The flag is set in ext/configuration.h and surfaced as sensitive: true in metadata/supported-configurations.json by the generator. Tests added under tests/ext/telemetry/.

Reviewer checklist

  • Test coverage seems ok.
  • Appropriate labels assigned.

@bm1549 bm1549 added the AI Generated Largely based on code generated by an AI or LLM. This label is the same across all dd-trace-* repos label Jun 6, 2026
@datadog-datadog-prod-us1-2

datadog-datadog-prod-us1-2 Bot commented Jun 6, 2026

Copy link
Copy Markdown

Pipelines  Tests

Fix all issues with BitsAI

⚠️ Warnings

🚦 20 Pipeline jobs failed

DataDog/apm-reliability/dd-trace-php | test_integrations_swoole_5: [8.3]   View in Datadog   GitLab

DataDog/apm-reliability/dd-trace-php | test_integrations_swoole_5: [8.4]   View in Datadog   GitLab

DataDog/apm-reliability/dd-trace-php | test_extension_ci: [7.0]   View in Datadog   GitLab

View all 20 failed jobs.

1 Test performance regression detected

testScenarioGetWithView from tests/Integrations/Magento/V2_4.DDTrace\Tests\Integrations\Magento\V2_4\CommonScenariosTest — 6.88s (+5.52s, +405%)   View in Datadog

ℹ️ Info

No other issues found (see more)

🧪 All tests passed
❄️ No new flaky tests detected

🎯 Code Coverage (details)
Patch Coverage: 100.00%
Overall Coverage: 54.11% (+0.03%)

Useful? React with 👍 / 👎

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: b5e01e5 | Docs | Datadog PR Page | Give us feedback!

@pr-commenter

pr-commenter Bot commented Jun 6, 2026

Copy link
Copy Markdown

Benchmarks [ tracer ]

Benchmark execution time: 2026-06-12 19:40:59

Comparing candidate commit b5e01e5 in PR branch brian.marks/omit-sensitive-config-telemetry with baseline commit 46641ee in branch master.

Found 3 performance improvements and 7 performance regressions! Performance is the same for 184 metrics, 0 unstable metrics.

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 ----------------------------------'

scenario:MessagePackSerializationBench/benchMessagePackSerialization

  • 🟩 execution_time [-3.588µs; -2.892µs] or [-3.281%; -2.644%]

scenario:MessagePackSerializationBench/benchMessagePackSerialization-opcache

  • 🟩 execution_time [-7.901µs; -6.159µs] or [-6.983%; -5.444%]

scenario:PDOBench/benchPDOOverhead

  • 🟥 execution_time [+7.963µs; +11.198µs] or [+3.110%; +4.374%]

scenario:PDOBench/benchPDOOverhead-opcache

  • 🟥 execution_time [+9.088µs; +11.568µs] or [+3.583%; +4.560%]

scenario:PDOBench/benchPDOOverheadWithDBM

  • 🟥 execution_time [+10.047µs; +12.215µs] or [+3.954%; +4.807%]

scenario:PDOBench/benchPDOOverheadWithDBM-opcache

  • 🟥 execution_time [+10.276µs; +12.529µs] or [+4.063%; +4.954%]

scenario:PHPRedisBench/benchRedisOverhead

  • 🟥 execution_time [+37.790µs; +53.750µs] or [+3.730%; +5.305%]

scenario:PHPRedisBench/benchRedisOverhead-opcache

  • 🟥 execution_time [+43.019µs; +60.559µs] or [+4.109%; +5.785%]

scenario:SamplingRuleMatchingBench/benchRegexMatching4-opcache

  • 🟩 execution_time [-138.923ns; -56.477ns] or [-7.666%; -3.117%]

scenario:SpanBench/benchOpenTelemetryInteroperability-opcache

  • 🟥 execution_time [+34.983µs; +42.098µs] or [+9.608%; +11.562%]

@bm1549 bm1549 force-pushed the brian.marks/omit-sensitive-config-telemetry branch 4 times, most recently from 2f0534f to b468a83 Compare June 12, 2026 18:09
Add a `sensitive` flag to the configuration definition (zai_config_entry and its
memoized entry) so a DD_* configuration can be marked in its CONFIG(...)
declaration in ext/configuration.h. The configuration-telemetry enqueue loop
over the DD_* config table skips entries whose flag is set; DD_API_KEY and
DD_TRACE_ENABLED carry it.

Remove the OTLP header configurations (OTEL_EXPORTER_OTLP_HEADERS,
OTEL_EXPORTER_OTLP_METRICS_HEADERS, OTEL_EXPORTER_OTLP_LOGS_HEADERS) from the
OpenTelemetry SDK configuration whitelist so they are not tracked for telemetry.

Derive the "sensitive": true markers in metadata/supported-configurations.json
from the flag in ext/configuration.h, plus the OTLP header variants the
generator lists.

Add a .phpt test and extend the loader functional test to assert these
configuration values do not appear in the enqueued configuration telemetry
while non-sensitive configurations remain reported.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@bm1549 bm1549 force-pushed the brian.marks/omit-sensitive-config-telemetry branch from b468a83 to b5e01e5 Compare June 12, 2026 18:18
@pr-commenter

pr-commenter Bot commented Jun 12, 2026

Copy link
Copy Markdown

Benchmarks [ profiler ]

Benchmark execution time: 2026-06-12 18:37:47

Comparing candidate commit b5e01e5 in PR branch brian.marks/omit-sensitive-config-telemetry with baseline commit 46641ee in branch master.

Found 0 performance improvements and 0 performance regressions! Performance is the same for 28 metrics, 8 unstable metrics.

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 ----------------------------------'

Comment thread ext/telemetry.c
#endif
if (cfg->names[0].len != sizeof("DD_TRACE_ENABLED") - 1
|| memcmp(cfg->names[0].ptr, "DD_TRACE_ENABLED", sizeof("DD_TRACE_ENABLED") - 1) != 0) { // DD_TRACE_ENABLED is meaningless: always off at rshutdown
if (!cfg->sensitive) {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While DD_TRACE_ENABLED isn't sensitive, it can be handled in the same way

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI Generated Largely based on code generated by an AI or LLM. This label is the same across all dd-trace-* repos

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant