Skip to content

[chore] Upgrade datadog-metrics with patch to use undici#2256

Open
Drarig29 wants to merge 1 commit into
masterfrom
corentin.girard/custom-undici-datadog-metrics-reporter
Open

[chore] Upgrade datadog-metrics with patch to use undici#2256
Drarig29 wants to merge 1 commit into
masterfrom
corentin.girard/custom-undici-datadog-metrics-reporter

Conversation

@Drarig29
Copy link
Copy Markdown
Contributor

@Drarig29 Drarig29 commented Apr 10, 2026

What and why?

Upgrades datadog-metrics from 0.9.3 to 0.13.0-pre.1 and patches it to use undici instead of cross-fetch as its HTTP transport. This lets metrics honor proxy settings (via undici's dispatcher) without relying on the removed agent option or proxy-agent.

How?

  • upgrade datadog-metrics to 0.13.0-pre.1 and remove the legacy @types/datadog-metrics dependency
  • apply a yarn patch to swap cross-fetchundici in datadog-metrics's reporter
  • remove the ProxyAgent instantiation and agent option from metrics.ts
  • update the flush call to use async/await to match the new promise-based API
  • update the Jest mock to match the new async reporter and class-based logger

Review checklist

  • Feature or bugfix MUST have appropriate tests (unit, integration)

@Drarig29 Drarig29 added the chores Related to the CI or developer experience label Apr 10, 2026
@Drarig29 Drarig29 changed the title Update datadog-metrics to use an undici-backed reporter [chore] Update datadog-metrics to use an undici-backed reporter Apr 10, 2026
Comment thread standalone-e2e/standalone-binary.test.ts Outdated
@Drarig29 Drarig29 force-pushed the corentin.girard/custom-undici-datadog-metrics-reporter branch from 2594372 to 7cc8f47 Compare April 10, 2026 17:56
@Drarig29 Drarig29 changed the title [chore] Update datadog-metrics to use an undici-backed reporter [chore] Upgrade datadog-metrics with patch to use undici Apr 10, 2026
@Drarig29 Drarig29 marked this pull request as ready for review April 10, 2026 18:02
@Drarig29 Drarig29 requested a review from a team as a code owner April 10, 2026 18:02
@Drarig29 Drarig29 force-pushed the corentin.girard/custom-undici-datadog-metrics-reporter branch from 7cc8f47 to ece6c91 Compare April 10, 2026 19:25
Copy link
Copy Markdown
Contributor

@ava-silver ava-silver left a comment

Choose a reason for hiding this comment

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

Is there a plan to support this without the patch longer term?

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

Labels

chores Related to the CI or developer experience

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants