Skip to content

fix(agentless): fix agentless crashtracking setup - #10175

Open
bwoebi wants to merge 4 commits into
masterfrom
bob/agentless-crashtracking
Open

fix(agentless): fix agentless crashtracking setup#10175
bwoebi wants to merge 4 commits into
masterfrom
bob/agentless-crashtracking

Conversation

@bwoebi

@bwoebi bwoebi commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Setting the correct env variables, and don't override the intake-settings of the crashtracker itself for no reason.

Setting the correct env variables, and don't override the intake-settings of the crashtracker itself for no reason.
@bwoebi
bwoebi requested review from a team as code owners September 6, 2026 01:09
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 6, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-07T18:42:26.475162Z 743e58f New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@dd-octo-sts

dd-octo-sts Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Overall package size

Self size: 8.83 MB
Deduped: 9.5 MB
No deduping: 9.5 MB

Dependency sizes | name | version | self size | total size | |------|---------|-----------|------------| | import-in-the-middle | 3.4.0 | 127.33 kB | 447.04 kB | | opentracing | 0.14.7 | 194.81 kB | 194.81 kB | | dc-polyfill | 0.1.11 | 25.74 kB | 25.74 kB |

🤖 This report was automatically generated by heaviest-objects-in-the-universe

@codecov

codecov Bot commented Sep 6, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 59.57%. Comparing base (ca391e1) to head (743e58f).
⚠️ Report is 10 commits behind head on master.

❗ There is a different number of reports uploaded between BASE (ca391e1) and HEAD (743e58f). Click for more details.

HEAD has 47 uploads less than BASE
Flag BASE (ca391e1) HEAD (743e58f)
ai-guard 4 1
openfeature 4 1
platform 4 1
apm-capabilities 5 0
instrumentation 4 1
profiling 4 0
debugger 6 1
llmobs 4 0
serverless 5 0
appsec 4 0
apm-integrations 4 0
test-optimization 4 0
Additional details and impacted files
@@             Coverage Diff             @@
##           master   #10175       +/-   ##
===========================================
- Coverage   98.65%   59.57%   -39.08%     
===========================================
  Files        1005      617      -388     
  Lines      157435   109495    -47940     
  Branches       74       58       -16     
===========================================
- Hits       155312    65232    -90080     
- Misses       2123    44263    +42140     
Flag Coverage Δ
ai-guard 65.00% <87.50%> (-0.03%) ⬇️
apm-capabilities ?
apm-integrations ?
appsec ?
debugger 69.79% <87.50%> (-0.05%) ⬇️
instrumentation 53.68% <87.50%> (-0.06%) ⬇️
llmobs ?
master-coverage 59.57% <100.00%> (?)
openfeature 66.38% <87.50%> (-0.04%) ⬇️
platform 69.22% <100.00%> (-0.10%) ⬇️
profiling ?
serverless ?
test-optimization ?

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 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.

@datadog-datadog-prod-us1-2

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

Copy link
Copy Markdown

Pipelines  Tests

⚠️ Warnings

Your PR has failed checks. Please review the issues below and take necessary action before merging.

🚦 12 Pipeline jobs failed

APM Capabilities | tracing-macos — 🔧 Needs a code fix, caused by this PR

View more details · View in GitHub Actions

2 failed tests. Test case failures during independent direct intake configuration.

APM Capabilities | tracing-ubuntu (active) — 🔧 Needs a code fix, caused by this PR

View more details · View in GitHub Actions

2 failed tests. AssertionError: Expected values to be strictly deep-equal in crashtracker.spec.js:127.

APM Capabilities | tracing-ubuntu (latest) — 🔧 Needs a code fix, caused by this PR

View more details · View in GitHub Actions

2 tests failed due to assertion errors in crashtracker.spec.js. Expected values to be strictly deep-equal, but actual values were undefined.

View all 12 failed jobs.

📋 Copy fix prompt
CI on my pull request is failing. Help me find and fix the root cause of each failing job below — they were flagged as caused by changes in this PR, so focus on the diff. For each job, explain the failure and propose a fix.

Before you start, set up the Datadog software-delivery tooling so you can
query the CI data yourself:

1. Check whether you already have the Datadog software-delivery MCP tools
   (e.g. a `search_datadog_ci_pipeline_events` tool) and the `unblock-pr` skill.
2. If either is missing, STOP and ask me for permission before installing
   anything. Do not install or run anything until I have said yes.
3. Only with my explicit approval, set up the Datadog software-delivery MCP
   server and skills by following:
     https://docs.datadoghq.com/getting_started/software_delivery_mcp_tools/
   then restart so the skill is picked up.
4. If I decline, skip all of the above and work from the context below alone.

Then run /unblock-pr — it will pull the CI data itself. The job context below is what we already know.

If /unblock-pr is not available — because I declined the setup above, or it did not install — work from the context below instead.

Datadog has already classified this failure as caused by changes in this PR.
Take that as given and work the fix:

1. Locate the change. Diff this branch against its base and find the change
   that produces this error. Explain the mechanism, don't just name a file:
     git fetch origin && git diff $(git merge-base origin/master HEAD)...HEAD
2. Reproduce it locally. Run the failing job's command or test before
   proposing anything.
3. Propose the smallest fix that addresses the root cause — not a workaround,
   not a broadened assertion, not a disabled or skipped test.
4. Re-run the same command to confirm, and say exactly what you ran.
5. If the failure turns out to be intermittent rather than deterministic, say
   so plainly instead of "fixing" it — that is a flaky test, and patching it
   hides the problem.

If the right move is to re-run the job rather than change code, use the job
link in the context below. For GitHub Actions: `gh run rerun <run-id> --failed`,
where the run ID is the number after `/runs/` in that URL (not the trailing
number, which is the job ID).

Branch: bob/agentless-crashtracking

APM Capabilities | tracing-macos
Commit: e112a3c87dd540faf284a6554cf7081783067277
Error (code / test):
2 failed tests. Test case failures during independent direct intake configuration.
CI job: https://github.com/DataDog/dd-trace-js/actions/runs/34152258513/job/101836784460

APM Capabilities | tracing-ubuntu (active)
Commit: e112a3c87dd540faf284a6554cf7081783067277
Error (code / test):
2 failed tests. AssertionError: Expected values to be strictly deep-equal in crashtracker.spec.js:127.
CI job: https://github.com/DataDog/dd-trace-js/actions/runs/34152258513/job/101836784626

APM Capabilities | tracing-ubuntu (latest)
Commit: e112a3c87dd540faf284a6554cf7081783067277
Error (code / test):
2 tests failed due to assertion errors in crashtracker.spec.js. Expected values to be strictly deep-equal, but actual values were undefined.
CI job: https://github.com/DataDog/dd-trace-js/actions/runs/34152258513/job/101836784576

Plus 3 more failing jobs not shown here.

🧪 1 Test failed in 1 job

Platform | crashtracking — ❌ 1 test failed

View more details · View in GitHub Actions

❌ crashtracking integration unix signal crash sends native crash data directly to both agentless intakes from unix signal crash   View in Datadog
Timeout waiting for agentless crash requests; received: /api/v2/errorsintake, /api/v2/errorsintake
Fixture stderr:

Error: Timeout waiting for agentless crash requests; received: /api/v2/errorsintake, /api/v2/errorsintake
Fixture stderr: 
    at Timeout.&lt;anonymous&gt; (integration-tests/crashtracking/crashtracking.spec.js:59:14)
    at listOnTimeout (node:internal/timers:605:17)
    at process.processTimers (node:internal/timers:541:7)

ℹ️ Info

No other issues found (see more)

❄️ No new flaky tests detected

🎯 Code Coverage (details)
Patch Coverage: 100.00%
Overall Coverage: 59.56% (-38.59%)

Useful? React with 👍 / 👎

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 743e58f | Docs | View more details | Give us feedback!

@pr-commenter

pr-commenter Bot commented Sep 6, 2026

Copy link
Copy Markdown

Benchmarks

Benchmark execution time: 2026-09-07 18:50:57

Comparing candidate commit 743e58f in PR branch bob/agentless-crashtracking with baseline commit ca391e1 in branch master.

📊 Benchmarking dashboard

Found 0 performance improvements and 0 performance regressions! Performance is the same for 2306 metrics, 7 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 ----------------------------------'

Unstable benchmarks

These benchmarks have a confidence interval too wide to call a change; treat them as noise rather than signal.

scenario:debugger-line-probe-with-snapshot-minimal-26

  • unstable max_rss_usage [-15.950MB; +22.764MB] or [-6.438%; +9.189%]

scenario:encoders-0.4-immediate-flush-20

  • unstable max_rss_usage [-9.650MB; -0.670MB] or [-13.059%; -0.906%]

scenario:llmobs-encode-unicode-mixed-20

  • unstable max_rss_usage [-6.196MB; +12.721MB] or [-8.456%; +17.362%]

scenario:plugin-cassandra-driver-batch-20

  • unstable execution_time [-80.850ms; +135.772ms] or [-3.883%; +6.521%]

scenario:plugin-graphql-long-with-depth-on-max-26

  • unstable max_rss_usage [-14.923MB; +22.235MB] or [-8.094%; +12.059%]

scenario:plugin-mongodb-core-binary-hash-24

  • unstable execution_time [-135.284ms; +198.237ms] or [-4.610%; +6.755%]

scenario:plugin-mongodb-core-plain-find-26

  • unstable execution_time [-77.434ms; +135.344ms] or [-3.766%; +6.582%]

Comment thread packages/dd-trace/src/crashtracking/crashtracker.js Outdated

@BridgeAR BridgeAR left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

If we want to lower case the site, we should do it as transformer in supported-configuration.json

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 68e83962d5

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +145 to +146
const url = config.DD_AGENTLESS_ENABLED ? getAgentlessTelemetryUrl(config.site) : config.url
const endpoint = {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Remove the duplicated endpoint declaration

When DD_CRASHTRACKING_ENABLED is true, Node cannot parse this module because the appended block leaves the preceding else structure malformed and redeclares endpoint. crashtracking/index.js catches that load failure and substitutes the noop implementation, so crash reports are silently disabled for every affected main-thread process.

Useful? React with 👍 / 👎.

bwoebi and others added 2 commits September 7, 2026 17:57
Co-authored-by: Ruben Bridgewater <ruben@bridgewater.de>
@bwoebi
bwoebi force-pushed the bob/agentless-crashtracking branch from 68e8396 to 8cfe517 Compare September 7, 2026 15:57
@bwoebi
bwoebi requested a review from a team as a code owner September 7, 2026 15:57
@bwoebi
bwoebi requested a review from BridgeAR September 7, 2026 15:57

@BridgeAR BridgeAR left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This seems to actually not work as expected. Please verify this against libdatadog once more

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 743e58fbcc

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".


sinon.assert.calledOnce(binding.init)
assert.strictEqual(binding.init.firstCall.args[0].endpoint, null)
assert.deepStrictEqual(binding.init.firstCall.args[0].endpoint, {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Align the endpoint assertion with the undefined endpoint

In agentless mode, #getConfig() now always supplies undefined for endpoint, so this new assertion expecting a populated telemetry endpoint deterministically fails in the Linux crashtracker unit suite. Update the expectation to match the environment-controlled configuration, or restore the endpoint construction if that remains intended.

AGENTS.md reference: AGENTS.md:L32-L38

Useful? React with 👍 / 👎.

Comment thread packages/dd-trace/src/crashtracking/crashtracker.js
// libdatadog v43 parses the dedicated URL above but does not use it when constructing the
// endpoint. Keep this compatibility fallback until its telemetry config honors that setting.
['DD_TRACE_AGENT_URL', telemetryUrl],
['DD_CRASHTRACKING_ERRORS_INTAKE_ENABLED', 'true'],

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Redirect telemetry in the agentless integration fixture

In the required platform.yml crashtracking job, the agentless fixture redirects only DD_ERRORS_INTAKE_DD_URL; it previously redirected telemetry through the helper stub and the environment entries removed here. Since the production code now leaves endpoint undefined and no longer loads that helper, telemetry goes to the site-derived external intake rather than the fixture's local server, so collectAgentlessCrashRequests() never observes /api/v2/apmtelemetry and times out. Add the native telemetry URL override to the receiver environment in the fixture.

AGENTS.md reference: AGENTS.md:L153-L159

Useful? React with 👍 / 👎.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants