Skip to content

Conversation

@Lewis-E
Copy link
Contributor

@Lewis-E Lewis-E commented Dec 26, 2025

What does this PR do?

  • Adds a NamedPipe BufferReader option to let Dogstatsd use windows specific functionality
  • Adopts the multi-instance approach used by winio and the main agent: one server instance per client, spawned in separate tasks.
  • Uses DD_DOGSTATSD_WINDOWS_PIPE_NAME for config + DD_DOGSTATSD_PORT is overridden to 0 when pipe name is set
  • The issue of multiple functions is NOT solved by this PR. We need to add a uniqueness factor to the envvar to handle multiple functions in the same plan, similar to the AAS extension GUID usage, but this needs to be handled 1) at the compat layer so it can be distributed to the rust mini-agent and the dogstatsd library from a single source of truth, and 2) we can't modify envvars in java, so we will also need to add another communication method to dogstatsd java envvar handling.

Motivation

  • When multiple functions run in Windows run on the same plan, only one can connect due to port conflicts for trace agent and dogstatsd agent. The Serverless Compatibility Layer should use named pipes in Windows for transport to prevent this issue.

Additional Notes

Describe how to test/QA your changes

  • New #[cfg(test)] in integration_tests.rs
  • Manual testing in Azure
Screenshot 2025-12-31 at 11 25 00 AM

Separate ticket to add this to self-monitoring when the multiple functions functionality is added: https://datadoghq.atlassian.net/browse/SVLS-8248

@Lewis-E Lewis-E force-pushed the lewis/SVLS-6029/dogstatsd-named-pipes branch 6 times, most recently from e7a5438 to 0ceae51 Compare December 29, 2025 16:06
@Lewis-E Lewis-E force-pushed the lewis/SVLS-6029/dogstatsd-named-pipes branch 9 times, most recently from 56e891e to 104d4b6 Compare December 29, 2025 19:12
@Lewis-E Lewis-E force-pushed the lewis/SVLS-6029/dogstatsd-named-pipes branch 2 times, most recently from 6d4e402 to f97a7e0 Compare December 29, 2025 19:44
enum BufferReader {
UdpSocketReader(tokio::net::UdpSocket),
/// UDP socket reader (cross-platform, default transport)
UdpSocket(tokio::net::UdpSocket),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Clippy change to remove consistent suffix. (All buffer readers are readers.)

@Lewis-E Lewis-E force-pushed the lewis/SVLS-6029/dogstatsd-named-pipes branch 3 times, most recently from 019a129 to 55e1a9e Compare December 30, 2025 14:42
@Lewis-E Lewis-E force-pushed the lewis/SVLS-6029/dogstatsd-named-pipes branch 4 times, most recently from 3001c28 to 39e2c02 Compare December 30, 2025 15:28
@Lewis-E Lewis-E force-pushed the lewis/SVLS-6029/dogstatsd-named-pipes branch from 39e2c02 to ab33264 Compare December 30, 2025 15:55
@Lewis-E Lewis-E force-pushed the lewis/SVLS-6029/dogstatsd-named-pipes branch 7 times, most recently from 6b4b1bb to c0d7e40 Compare December 31, 2025 15:32
@Lewis-E Lewis-E force-pushed the lewis/SVLS-6029/dogstatsd-named-pipes branch from c0d7e40 to d1d2113 Compare December 31, 2025 16:08
@Lewis-E Lewis-E force-pushed the lewis/SVLS-6029/dogstatsd-named-pipes branch from 5f7a68f to 9dd35a0 Compare December 31, 2025 19:54
@Lewis-E Lewis-E force-pushed the lewis/SVLS-6029/dogstatsd-named-pipes branch from 9dd35a0 to da9b9b3 Compare December 31, 2025 19:59
@Lewis-E Lewis-E changed the title Draft: Add Windows Named Pipes to Dogstatsd Add Windows Named Pipes to Dogstatsd Jan 2, 2026
@Lewis-E Lewis-E marked this pull request as ready for review January 2, 2026 14:32
@Lewis-E Lewis-E requested review from a team as code owners January 2, 2026 14:32
@Lewis-E Lewis-E requested review from apiarian-datadog and removed request for a team January 2, 2026 14:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants