Skip to content

fix(profiling): respect ZAI_CONFIG_ORIGIN_DEFAULT for agent endpoint detection#3677

Merged
morrisonlevi merged 2 commits intomasterfrom
leiyks/fix-ssi-tests
Feb 26, 2026
Merged

fix(profiling): respect ZAI_CONFIG_ORIGIN_DEFAULT for agent endpoint detection#3677
morrisonlevi merged 2 commits intomasterfrom
leiyks/fix-ssi-tests

Conversation

@Leiyks
Copy link
Copy Markdown
Contributor

@Leiyks Leiyks commented Feb 26, 2026

Description

Since a3409cd78, DD_AGENT_HOST and DD_TRACE_AGENT_PORT have non-empty defaults ("localhost" / 8126). The PHP tracer already filters these with ZAI_CONFIG_ORIGIN_DEFAULT checks, but the Rust profiling code was not updated — causing agent_host() and trace_agent_port() to return Some(...) unconditionally and bypass the Unix socket fallback that SSI environments rely on.

Fix: adds ddog_php_prof_config_is_set_by_user() (checks name_index != ZAI_CONFIG_ORIGIN_DEFAULT) and gates both functions on it.

Also pins cargo install cbindgen to --version 0.29.0 --locked to avoid getrandom v0.4.1 pulling in edition2024 support, which requires Cargo ≥ 1.85 (container is on 1.84.1).

Reviewer checklist

  • Test coverage seems ok.
  • Appropriate labels assigned.

Signed-off-by: Alexandre Rulleau <alexandre.rulleau@datadoghq.com>
@github-actions github-actions Bot added profiling Relates to the Continuous Profiler tracing labels Feb 26, 2026
@datadog-datadog-prod-us1
Copy link
Copy Markdown

datadog-datadog-prod-us1 Bot commented Feb 26, 2026

⚠️ Tests

Fix all issues with BitsAI or with Cursor

⚠️ Warnings

🧪 1028 Tests failed

testSearchPhpBinaries from integration.DDTrace\Tests\Integration\PHPInstallerTest (Datadog) (Fix with Cursor)
Risky Test
phpvfscomposer://tests/vendor/phpunit/phpunit/phpunit:52
testSimplePushAndProcess from laravel-58-test.DDTrace\Tests\Integrations\Laravel\V5_8\QueueTest (Datadog) (Fix with Cursor)
DDTrace\Tests\Integrations\Laravel\V5_8\QueueTest::testSimplePushAndProcess
Test code or tested code printed unexpected output: spanLinksTraceId: 69a0473300000000a106d609a5ea62c4
tid: 69a0473300000000
hexProcessTraceId: a106d609a5ea62c4
hexProcessSpanId: a7a511e14eaf8dac
processTraceId: 11603196826893312708
processSpanId: 12080081234876665260

phpvfscomposer://tests/vendor/phpunit/phpunit/phpunit:106
testSimplePushAndProcess from laravel-8x-test.DDTrace\Tests\Integrations\Laravel\V8_x\QueueTest (Datadog) (Fix with Cursor)
DDTrace\Tests\Integrations\Laravel\V8_x\QueueTest::testSimplePushAndProcess
Test code or tested code printed unexpected output: spanLinksTraceId: 69a0478100000000f54195369fb3855e
tid: 69a0478100000000
hexProcessTraceId: f54195369fb3855e
hexProcessSpanId: a07e8680c9004fdd
processTraceId: 17672570474618651998
processSpanId: 11564828780820189149
View all

ℹ️ Info

❄️ No new flaky tests detected

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

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Feb 26, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 62.08%. Comparing base (07b618a) to head (a1903e7).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3677      +/-   ##
==========================================
- Coverage   62.19%   62.08%   -0.12%     
==========================================
  Files         141      141              
  Lines       13352    13352              
  Branches     1746     1746              
==========================================
- Hits         8304     8289      -15     
- Misses       4256     4270      +14     
- Partials      792      793       +1     

see 3 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 07b618a...a1903e7. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@pr-commenter
Copy link
Copy Markdown

pr-commenter Bot commented Feb 26, 2026

Benchmarks [ profiler ]

Benchmark execution time: 2026-02-26 13:20:34

Comparing candidate commit a1903e7 in PR branch leiyks/fix-ssi-tests with baseline commit 07b618a in branch master.

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

Signed-off-by: Alexandre Rulleau <alexandre.rulleau@datadoghq.com>
@Leiyks Leiyks changed the title test(CI): filter default value in profiler code fix(profiling): respect ZAI_CONFIG_ORIGIN_DEFAULT for agent endpoint detection Feb 26, 2026
@Leiyks Leiyks marked this pull request as ready for review February 26, 2026 14:23
@Leiyks Leiyks requested review from a team as code owners February 26, 2026 14:23
Copy link
Copy Markdown
Collaborator

@morrisonlevi morrisonlevi left a comment

Choose a reason for hiding this comment

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

The profiling parts look good to me. Not sure why the package-oci jobs failed, which should be investigated before merging (but not necessarily fixed, depends if it's related or not).

Copy link
Copy Markdown
Collaborator

@morrisonlevi morrisonlevi left a comment

Choose a reason for hiding this comment

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

package-oci failures are unrelated. Merging.

@morrisonlevi morrisonlevi merged commit 6733f8f into master Feb 26, 2026
2070 of 2073 checks passed
@morrisonlevi morrisonlevi deleted the leiyks/fix-ssi-tests branch February 26, 2026 17:05
@github-actions github-actions Bot added this to the 1.17.0 milestone Feb 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

profiling Relates to the Continuous Profiler tracing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants