{"action":"created","issue":{"url":"https://api.github.com/repos/DataDog/datadogpy/issues/199","repository_url":"https://api.github.com/repos/DataDog/datadogpy","labels_url":"https://api.github.com/repos/DataDog/datadogpy/issues/199/labels{/name}","comments_url":"https://api.github.com/repos/DataDog/datadogpy/issues/199/comments","events_url":"https://api.github.com/repos/DataDog/datadogpy/issues/199/events","html_url":"https://github.com/DataDog/datadogpy/pull/199","id":228954535,"number":199,"title":"add use_unix_socket option to enable unix socket traffic to dogstatsd6","user":{"login":"xvello","id":6241083,"avatar_url":"https://avatars1.githubusercontent.com/u/6241083?v=3","gravatar_id":"","url":"https://api.github.com/users/xvello","html_url":"https://github.com/xvello","followers_url":"https://api.github.com/users/xvello/followers","following_url":"https://api.github.com/users/xvello/following{/other_user}","gists_url":"https://api.github.com/users/xvello/gists{/gist_id}","starred_url":"https://api.github.com/users/xvello/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xvello/subscriptions","organizations_url":"https://api.github.com/users/xvello/orgs","repos_url":"https://api.github.com/users/xvello/repos","events_url":"https://api.github.com/users/xvello/events{/privacy}","received_events_url":"https://api.github.com/users/xvello/received_events","type":"User","site_admin":false},"labels":[{"id":315142560,"url":"https://api.github.com/repos/DataDog/datadogpy/labels/dogstatsd","name":"dogstatsd","color":"5319e7","default":false},{"id":171070154,"url":"https://api.github.com/repos/DataDog/datadogpy/labels/enhancement","name":"enhancement","color":"84b6eb","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2017-05-16T08:34:49Z","updated_at":"2017-05-26T18:47:48Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/DataDog/datadogpy/pulls/199","html_url":"https://github.com/DataDog/datadogpy/pull/199","diff_url":"https://github.com/DataDog/datadogpy/pull/199.diff","patch_url":"https://github.com/DataDog/datadogpy/pull/199.patch"},"body":"### What does this PR do?\r\n\r\ndogstatsd6 will allow custom metrics to be sent via a datagram unix socket instead of UDP (see https://github.com/DataDog/datadog-agent/pull/252). This PR add a use_unix_socket option to the DogstatsD object in order to allow using this communication channel.\r\n\r\n### Motivation\r\n\r\nContainers make it harder to reach the dogstatsd server from client applications and we don't have a future-proof network solution that could work across all orchestrators. This allows to bypass the network stack altogether and use a host-local protocol. See https://github.com/DataDog/docker-dd-agent/issues/195 for more context.\r\n\r\nAs unix datagram and UDP share the same semantics, the patch is pretty small and unobstrusive.\r\n\r\nSocket connection is set to non blocking: if the server is unresponsive, the packets are dropped, mirroring what would happen with UDP.\r\n\r\n### Additional Notes\r\n\r\nStill WIP as we need to:\r\n\r\n- [ ] Work on better error handling if the server stops (currently, the exceptions are caught and packets are dropped, but CPU usage increases significantly)"},"comment":{"url":"https://api.github.com/repos/DataDog/datadogpy/issues/comments/304360306","html_url":"https://github.com/DataDog/datadogpy/pull/199#issuecomment-304360306","issue_url":"https://api.github.com/repos/DataDog/datadogpy/issues/199","id":304360306,"user":{"login":"yannmh","id":5708089,"avatar_url":"https://avatars2.githubusercontent.com/u/5708089?v=3","gravatar_id":"","url":"https://api.github.com/users/yannmh","html_url":"https://github.com/yannmh","followers_url":"https://api.github.com/users/yannmh/followers","following_url":"https://api.github.com/users/yannmh/following{/other_user}","gists_url":"https://api.github.com/users/yannmh/gists{/gist_id}","starred_url":"https://api.github.com/users/yannmh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yannmh/subscriptions","organizations_url":"https://api.github.com/users/yannmh/orgs","repos_url":"https://api.github.com/users/yannmh/repos","events_url":"https://api.github.com/users/yannmh/events{/privacy}","received_events_url":"https://api.github.com/users/yannmh/received_events","type":"User","site_admin":false},"created_at":"2017-05-26T18:47:48Z","updated_at":"2017-05-26T18:47:48Z","body":"I am in favor of keeping the code very simple, i.e. avoid adding any back-off mechanism. \r\n\r\nDo you know what errors to expect? `error: [Errno 61] Connection refused` sounds like one, are there more? \r\nIf the list is relatively small, maybe we can filter those and avoid the systematic retry we do on: https://github.com/DataDog/datadogpy/blob/b06997af5947d9cf185b6f49a5733e02b8e5c451/datadog/dogstatsd/base.py#L294.\r\nIt may also not be necessary to re-create the socket.\r\n\r\n"}}
{"actor":{"display_login":"yannmh"}}