-
Notifications
You must be signed in to change notification settings - Fork 309
Add UDS SOCK_STREAM support to the DogStatsD client #869
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: master
Are you sure you want to change the base?
Conversation
41f1854
to
e62632e
Compare
e62632e
to
f496719
Compare
ae4d6be
to
f8be9f2
Compare
767c223
to
9220c5e
Compare
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.
""" | ||
statsd = DogStatsd(disable_buffering=True) | ||
|
||
class fakeSock: |
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.
⚪ Code Quality Violation
class names should be PascalCase (...read more)
Class names should be PascalCase
and not camelCase
or snake_case
.
Learn More
elif self._socket_kind == socket.SOCK_DGRAM: | ||
self._transport = "uds" | ||
self._max_payload_size = self._max_buffer_len or UDS_OPTIMAL_PAYLOAD_LENGTH | ||
else: |
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.
Aren't udp sockets SOCK_DGRAM
too?
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-incompatible
label attached.do-not-merge/
label attached.kind/
andseverity/
labels attached at least.