-
Notifications
You must be signed in to change notification settings - Fork 0
Add Windows Named Pipes to Dogstatsd #59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
6d4e402 to
f97a7e0
Compare
| enum BufferReader { | ||
| UdpSocketReader(tokio::net::UdpSocket), | ||
| /// UDP socket reader (cross-platform, default transport) | ||
| UdpSocket(tokio::net::UdpSocket), |
There was a problem hiding this comment.
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.)
a2d4505 to
011b3e3
Compare
|
@codex review |
There was a problem hiding this comment.
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: 669bcfa186
ℹ️ 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".
| let mut config_json = serde_json::json!({ | ||
| "statsd_port": dd_dogstatsd_port | ||
| }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Report no UDP port when named pipe is configured
When DD_DOGSTATSD_WINDOWS_PIPE_NAME is set on Windows, datadog-serverless-compat normalizes the pipe name and disables UDP by forcing the listener port to 0, but Config::new still reads DD_DOGSTATSD_PORT (default 8125) and this /info response always emits statsd_port from that value. In that setup, tracers that only consult statsd_port will try UDP even though no UDP socket is bound, so metrics will be dropped. Consider mirroring the server behavior by setting the port to 0 (or omitting statsd_port) when a pipe name is present so /info reflects the actual transport.
Useful? React with 👍 / 👎.
| }); | ||
|
|
||
| if let Some(pipe_name) = dd_dogstatsd_windows_pipe_name { | ||
| config_json["statsd_windows_pipe_name"] = serde_json::json!(pipe_name); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I checked the /info response in a Windows environment for a non-Serverless agent and statsd_windows_pipe_name is not set. The named pipe is not included in the response.
| } | ||
|
|
||
| // Create new named pipe server | ||
| let server = match ServerOptions::new().create(&*pipe_name) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you run into any permission issues when opening the named pipe? It would be good to understand what the default security descriptor is and if we should set a different value to match what's done in the non Serverless agent.
See https://datadoghq.atlassian.net/browse/SVLS-8192 for additional context
jcstorms1
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as #58. Logic looks good, but I'll defer more technical comments to those with more expertise.
669bcfa to
195d536
Compare
|
|
||
| const DOGSTATSD_FLUSH_INTERVAL: u64 = 10; | ||
| const DOGSTATSD_TIMEOUT_DURATION: Duration = Duration::from_secs(5); | ||
| const DEFAULT_DOGSTATSD_PORT: u16 = 8125; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved into config
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Going to undo this, actually. Separation of concerns for trace/dogstatsd
07fd58c to
a2d1b8f
Compare
a2d1b8f to
704609a
Compare
What does this PR do?
Motivation
Additional Notes
Describe how to test/QA your changes
Separate ticket to add this to self-monitoring when the multiple functions functionality is added: https://datadoghq.atlassian.net/browse/SVLS-8248