Add UDS SOCK_STREAM support to the DogStatsD client#869
Merged
carlosroman merged 4 commits intomasterfrom May 1, 2025
Merged
Conversation
41f1854 to
e62632e
Compare
e62632e to
f496719
Compare
ae4d6be to
f8be9f2
Compare
vickenty
reviewed
Nov 18, 2024
767c223 to
9220c5e
Compare
6 tasks
1bc03c2 to
c9dd150
Compare
671b149 to
4e8b412
Compare
|
This issue has been automatically marked as stale because it has not had activity in the last 30 days. |
Includes full support for the unix://, unixstream://, and unixgram:// socket_path prefixes utilized by DD_DOGSTATSD_URL in preparation to support that feature. Autodetects SOCK_DGRAM vs SOCK_STREAM for users currently providing a raw socket path.
…g the "size" and "message" packets are always sent one after another.
aec6574 to
7a4d85c
Compare
* Setting correct transport type max payload size when setting the socket.
vickenty
reviewed
Apr 25, 2025
| elif self._socket_kind == socket.SOCK_DGRAM: | ||
| self._transport = "uds" | ||
| self._max_payload_size = self._max_buffer_len or UDS_OPTIMAL_PAYLOAD_LENGTH | ||
| else: |
Contributor
There was a problem hiding this comment.
Aren't udp sockets SOCK_DGRAM too?
Contributor
There was a problem hiding this comment.
I've updated the way I check for they type of socket.
tobz
approved these changes
May 1, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Includes full support for the unix://, unixstream://, and unixgram:// socket_path prefixes utilized by DD_DOGSTATSD_URL in preparation to support that feature.
Autodetects SOCK_DGRAM vs SOCK_STREAM for users currently providing a raw socket path.
Description of the Change
Alternate Designs
Possible Drawbacks
Verification Process
Set up a datadog agent with both a datagram and a stream uds socket path.
Ensure that a client initialized with socket_path={socket_path} and socket_path=unix://{socket_path} can successfully transmit metrics/events/services to both types of sockets when socket_path is an absolute path and when socket_path is a relative path.
Similarly ensure that socket_path=unixstream://{socket_path} can send to the stream socket and socket_path=unixgram://{socket_path} can send to the datagram socket. Confirm for both prefixes that sending to the wrong socket_path produces an appropriate error.
Ensure for all configurations that invalid socket_paths are error handled in a sane manner.
This process should be repeated for the telemetry flow, where telemetry_socket_path is set rather than socket_path.
Additional Notes
Documentation pushing users to utilize unix://{socket_path} over {socket_path} will be introduced on the inclusion of DD_DOGSTATSD_URL support via https://datadoghq.atlassian.net/browse/AMLII-2173
Release Notes
Review checklist (to be filled by reviewers)
changelog/label attached. If applicable it should have thebackward-incompatiblelabel attached.do-not-merge/label attached.kind/andseverity/labels attached at least.