-
Notifications
You must be signed in to change notification settings - Fork 306
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
Add UDS SOCK_STREAM support to the DogStatsD client #869
Open
ddrthall
wants to merge
1
commit into
master
Choose a base branch
from
ryan.hall/add_uds_stream_support
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains 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
ddrthall
added
the
changelog/Added
Added features results into a minor version bump
label
Nov 15, 2024
ddrthall
force-pushed
the
ryan.hall/add_uds_stream_support
branch
from
November 15, 2024 20:15
41f1854
to
e62632e
Compare
ddrthall
added
ci/integrations
Run integration tests
and removed
ci/integrations
Run integration tests
labels
Nov 15, 2024
ddrthall
force-pushed
the
ryan.hall/add_uds_stream_support
branch
from
November 15, 2024 21:12
e62632e
to
f496719
Compare
ddrthall
force-pushed
the
ryan.hall/add_uds_stream_support
branch
2 times, most recently
from
November 18, 2024 14:41
ae4d6be
to
f8be9f2
Compare
vickenty
reviewed
Nov 18, 2024
datadog/dogstatsd/base.py
Outdated
Comment on lines
751
to
755
try: | ||
# This will fail in python2.7 | ||
sk_name = socket_kind.name | ||
except AttributeError: | ||
sk_name = socket_kind |
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.
What do you think about doing this instead?
Suggested change
try: | |
# This will fail in python2.7 | |
sk_name = socket_kind.name | |
except AttributeError: | |
sk_name = socket_kind | |
sk_name = { socket.SOCK_STREAM: "stream", socket.SOCK_DGRAM: "datagram" }[socket_kind] |
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.
Sold
ddrthall
force-pushed
the
ryan.hall/add_uds_stream_support
branch
4 times, most recently
from
November 18, 2024 19:10
77d6ced
to
767c223
Compare
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.
ddrthall
force-pushed
the
ryan.hall/add_uds_stream_support
branch
from
November 18, 2024 19:30
767c223
to
9220c5e
Compare
6 tasks
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-incompatible
label attached.do-not-merge/
label attached.kind/
andseverity/
labels attached at least.