Skip to content

feat(tracing): report OTLP export status in startup log#4056

Open
bm1549 wants to merge 2 commits into
masterfrom
brian.marks/otlp-export-startup-log
Open

feat(tracing): report OTLP export status in startup log#4056
bm1549 wants to merge 2 commits into
masterfrom
brian.marks/otlp-export-startup-log

Conversation

@bm1549

@bm1549 bm1549 commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Description

Adds three boolean fields to the "DATADOG TRACER CONFIGURATION" startup log (tracer/tracer_startup_logging.c):

  • otlp_traces_export_enabled: constant false. PHP has no OTLP trace export on master; OTEL_TRACES_EXPORTER=otlp is treated as invalid, and traces always go to the Datadog Agent.
  • otlp_metrics_export_enabled: get_DD_METRICS_OTEL_ENABLED().
  • otlp_logs_export_enabled: get_DD_LOGS_OTEL_ENABLED().

DD_METRICS_OTEL_ENABLED and DD_LOGS_OTEL_ENABLED were already registered, so no new configuration registration was needed. The metrics and logs getters read the same request-scoped values the userland OpenTelemetry resolver (DatadogResolver) consults, so the log matches actual export behavior.

The three .phpt startup-logging tests were updated to cover the new fields, including a case that sets DD_METRICS_OTEL_ENABLED=1 and DD_LOGS_OTEL_ENABLED=1 and asserts the metrics/logs flags flip to true.

Part of a cross-tracer effort to report OTLP export status with identical JSON keys across dd-trace-*.

Note for reviewers: current master already sits at the ZAI configuration ceiling (NUMBER_OF_CONFIGURATIONS == ZAI_CONFIG_ENTRIES_COUNT_MAX == 300), so a clean non-Windows build can trip the _Static_assert in ext/configuration.c independent of this change. This PR adds zero config entries, so it does not move that count, but CI may still surface the assert.

Reviewer checklist

  • Test coverage seems ok.
  • Appropriate labels assigned.

Related PRs — cross-tracer OTLP startup-log effort


CI note

The failing PHP Language Tests are PHP-core's own stream tests (ext/standard/tests/streams/opendir-003.phpt / opendir-004.phpt, opendir() over ftps://) failing on an expired upstream TLS certificate — unrelated to this change. The .phpt tests added by this PR pass. The remaining test_extension_ci / swoole reds are transient CI flakes.

Add otlp_traces_export_enabled, otlp_metrics_export_enabled, and
otlp_logs_export_enabled to the "DATADOG TRACER CONFIGURATION" startup
diagnostic log, matching the shared cross-language schema.

PHP exports traces natively via the Datadog Agent (never over OTLP), so
otlp_traces_export_enabled is always false. The metrics and logs flags
reflect the existing DD_METRICS_OTEL_ENABLED / DD_LOGS_OTEL_ENABLED
configs -- the same request-scoped values the userland OpenTelemetry
resolver consults -- so the log matches actual export behavior.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@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 Jul 24, 2026
@datadog-datadog-prod-us1-2

datadog-datadog-prod-us1-2 Bot commented Jul 24, 2026

Copy link
Copy Markdown

Pipelines  Tests

Unblock PR with BitsAI

⚠️ Warnings

🚦 35 Pipeline jobs failed

DataDog/apm-reliability/dd-trace-php | PHP Language Tests: [7.1]   View in Datadog   GitLab

🧪 2 Tests failed

All test failures are known flaky.

❄️ Known flaky: opendir-003.phpt - opendir() with &#39;ftps://&#39; stream. from php-src.php-src.ext.standard.tests.streams   View in Datadog
002&#43; error:0A000415:SSL routines::sslv3 alert certificate expired in /usr/local/src/php/ext/ftp/tests/server.inc on line 121
003&#43; SSLv23 handshake failed.
004&#43; 
006&#43; error:0A000086:SSL routines::certificate verify failed in /usr/local/src/php/ext/standard/tests/streams/opendir-003.php on line 10
007&#43; 
002-  in %s on line %d

Not introduced in this PR.

❄️ Known flaky: opendir-004.phpt - opendir() with &#39;ftps://&#39; stream. from php-src.php-src.ext.standard.tests.streams   View in Datadog
002&#43; error:0A000415:SSL routines::sslv3 alert certificate expired in /usr/local/src/php/ext/ftp/tests/server.inc on line 121
003&#43; SSLv23 handshake failed.
004&#43; 
006&#43; error:0A000086:SSL routines::certificate verify failed in /usr/local/src/php/ext/standard/tests/streams/opendir-004.php on line 10
007&#43; 
009&#43; bool(false)
010&#43; 
001- resource(%d) of type (stream)
002- string(5) &#34;file1&#34;
003- string(5) &#34;file1&#34;
...

Not introduced in this PR.

DataDog/apm-reliability/dd-trace-php | PHP Language Tests: [7.3]   View in Datadog   GitLab

🧪 1 Test failed

All test failures are known flaky.

❄️ Known flaky: opendir() with &#39;ftps://&#39; stream. from PHP.ext.standard.tests.streams   View in Datadog
002&#43; error:0A000086:SSL routines::certificate verify failed in /usr/local/src/php/ext/standard/tests/streams/opendir-004.php on line 10
003&#43; 
005&#43; bool(false)
006&#43; 
001- resource(%d) of type (stream)
002- string(5) &#34;file1&#34;
003- string(5) &#34;file1&#34;
004- string(3) &#34;fil&#34;
005- string(4) &#34;b0rk&#34;
009&#43; 
...

Not introduced in this PR.

DataDog/apm-reliability/dd-trace-php | PHP Language Tests: [8.0]   View in Datadog   GitLab

🧪 2 Tests failed

All test failures are known flaky.

❄️ Known flaky: ext/standard/tests/streams/opendir-003.phpt (opendir() with &#39;ftps://&#39; stream.) from PHP.ext.standard.tests.streams   View in Datadog
002&#43; error:0A000415:SSL routines::sslv3 alert certificate expired in /usr/local/src/php/ext/ftp/tests/server.inc on line 115
003&#43; 
005&#43; error:0A000086:SSL routines::certificate verify failed in /usr/local/src/php/ext/standard/tests/streams/opendir-003.php on line 10
006&#43; SSLv23 handshake failed.
007&#43; 
002-  in %s on line %d
     bool(false)

Not introduced in this PR.

❄️ Known flaky: ext/standard/tests/streams/opendir-004.phpt (opendir() with &#39;ftps://&#39; stream.) from PHP.ext.standard.tests.streams   View in Datadog
002&#43; error:0A000415:SSL routines::sslv3 alert certificate expired in /usr/local/src/php/ext/ftp/tests/server.inc on line 115
003&#43; 
005&#43; error:0A000086:SSL routines::certificate verify failed in /usr/local/src/php/ext/standard/tests/streams/opendir-004.php on line 10
001- resource(%d) of type (stream)
002- string(5) &#34;file1&#34;
003- string(5) &#34;file1&#34;
004- string(3) &#34;fil&#34;
005- string(4) &#34;b0rk&#34;
006&#43; SSLv23 handshake failed.
007&#43; 
...

Not introduced in this PR.

View all 35 failed jobs.

ℹ️ Info

No other issues found (see more)

❄️ No new flaky tests detected

🔄 Datadog auto-retried 1 job - 1 passed on retry View in Datadog

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

Useful? React with 👍 / 👎

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

@pr-commenter

pr-commenter Bot commented Jul 24, 2026

Copy link
Copy Markdown

Benchmarks [ tracer ]

Benchmark execution time: 2026-07-24 20:03:51

Comparing candidate commit 74464cc in PR branch brian.marks/otlp-export-startup-log with baseline commit acd5a0d in branch master.

Found 2 performance improvements and 5 performance regressions! Performance is the same for 187 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:PHPRedisBench/benchRedisOverhead

  • 🟥 execution_time [+32.334µs; +44.115µs] or [+3.144%; +4.289%]

scenario:SamplingRuleMatchingBench/benchGlobMatching2-opcache

  • 🟩 execution_time [-193.494ns; -91.106ns] or [-6.664%; -3.138%]

scenario:SamplingRuleMatchingBench/benchRegexMatching1

  • 🟥 execution_time [+48.089ns; +126.111ns] or [+3.267%; +8.567%]

scenario:SamplingRuleMatchingBench/benchRegexMatching2

  • 🟥 execution_time [+98.240ns; +143.160ns] or [+6.678%; +9.732%]

scenario:SamplingRuleMatchingBench/benchRegexMatching3

  • 🟥 execution_time [+77.224ns; +162.576ns] or [+5.260%; +11.075%]

scenario:SamplingRuleMatchingBench/benchRegexMatching4

  • 🟥 execution_time [+89.374ns; +173.426ns] or [+6.167%; +11.967%]

scenario:TraceSerializationBench/benchSerializeTrace-opcache

  • 🟩 execution_time [-65.036µs; -31.764µs] or [-4.158%; -2.031%]

@bm1549
bm1549 marked this pull request as ready for review July 24, 2026 21:41
@bm1549
bm1549 requested a review from a team as a code owner July 24, 2026 21:41
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