Skip to content

Exclude OTLP header and Datadog key configs from telemetry - #3961

Open
bm1549 wants to merge 10 commits into
masterfrom
brian.marks/omit-sensitive-config-telemetry
Open

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

Conversation

@bm1549

@bm1549 bm1549 commented Jun 6, 2026

Copy link
Copy Markdown
Collaborator

Description

Stops configuration telemetry from reporting DD_API_KEY or OTLP exporter header values.

DD_API_KEY now uses a sensitivity flag carried through ZAI config metadata. The OTLP header configs remain in supported-config metadata with sensitive: true, but are rejected at the PHP whitelist and native ingestion boundaries. DD_TRACE_ENABLED remains omitted separately because its shutdown-time value is not meaningful.

The metadata generator now reads sensitivity from all config headers and uses comment/string-aware parsing. Its CI self-test covers parser edge cases. Runtime coverage checks the native bypass path and a future OTLP traces header variant, with safe configs as positive controls.

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

⚠️ Warnings

🚦 4 Pipeline jobs failed

DataDog/apm-reliability/dd-trace-php | merge-gate   View in Datadog   GitLab

DataDog/apm-reliability/dd-trace-php | publish docker image for system tests   View in Datadog   GitLab

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

View all 4 failed jobs.

🧪 1 Test failed in 1 job

DataDog/apm-reliability/dd-trace-php | appsec integration tests: [test8.0-release]

initializationError from com.datadog.appsec.php.integration.RoadRunnerTests   View in Datadog
com.github.dockerjava.api.exception.ConflictException: Status 409: {"message":"container e7590cd193092fd10b32bb6907db3e2ea952d595175652d91f1fb588ff711011 is not running"}

com.github.dockerjava.api.exception.ConflictException: Status 409: {"message":"container e7590cd193092fd10b32bb6907db3e2ea952d595175652d91f1fb588ff711011 is not running"}

	at app//org.testcontainers.shaded.com.github.dockerjava.core.DefaultInvocationBuilder.execute(DefaultInvocationBuilder.java:245)
	at app//org.testcontainers.shaded.com.github.dockerjava.core.DefaultInvocationBuilder.post(DefaultInvocationBuilder.java:124)
	at app//org.testcontainers.shaded.com.github.dockerjava.core.exec.ExecCreateCmdExec.execute(ExecCreateCmdExec.java:30)
	at app//org.testcontainers.shaded.com.github.dockerjava.core.exec.ExecCreateCmdExec.execute(ExecCreateCmdExec.java:13)
	at app//org.testcontainers.shaded.com.github.dockerjava.core.exec.AbstrSyncDockerCmdExec.exec(AbstrSyncDockerCmdExec.java:21)
	at app//org.testcontainers.shaded.com.github.dockerjava.core.command.AbstrDockerCmd.exec(AbstrDockerCmd.java:33)
...

ℹ️ Info

No other issues found (see more)

❄️ No new flaky tests detected

🔄 Datadog auto-retried 8 jobs - 4 passed on retry View in Datadog

🎯 Code Coverage (details)
Patch Coverage: 100.00%
Overall Coverage: 60.65% (-0.03%)

Useful? React with 👍 / 👎

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: ea536a1 | 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-08-01 01:32:27

Comparing candidate commit ea536a1 in PR branch brian.marks/omit-sensitive-config-telemetry with baseline commit af463f7 in branch master.

Found 3 performance improvements and 3 performance regressions! Performance is the same for 187 metrics, 1 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 [-8.508µs; -6.492µs] or [-7.635%; -5.825%]

scenario:MessagePackSerializationBench/benchMessagePackSerialization-opcache

  • 🟩 execution_time [-9.362µs; -6.538µs] or [-8.136%; -5.681%]

scenario:PDOBench/benchPDOOverhead

  • 🟥 execution_time [+8.069µs; +10.736µs] or [+3.143%; +4.181%]

scenario:PDOBench/benchPDOOverheadWithDBM

  • 🟥 execution_time [+7.933µs; +11.112µs] or [+3.074%; +4.306%]

scenario:PHPRedisBench/benchRedisOverhead

  • 🟥 execution_time [+41.418µs; +54.008µs] or [+4.104%; +5.352%]

scenario:TraceAnnotationsBench/benchTraceAnnotationOverhead-opcache

  • 🟩 execution_time [-7.898µs; -4.252µs] or [-4.227%; -2.275%]

@bm1549
bm1549 force-pushed the brian.marks/omit-sensitive-config-telemetry branch 5 times, most recently 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-08-01 00:29:23

Comparing candidate commit ea536a1 in PR branch brian.marks/omit-sensitive-config-telemetry with baseline commit af463f7 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 Outdated
#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
Collaborator 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

@bm1549
bm1549 marked this pull request as ready for review July 29, 2026 22:08
@bm1549
bm1549 requested review from a team as code owners July 29, 2026 22:08
@bm1549
bm1549 requested review from LobeTia and removed request for a team July 29, 2026 22:08
bm1549 and others added 10 commits July 31, 2026 14:43
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 16486c5 to ea536a1 Compare July 31, 2026 19:50
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.

2 participants