diff --git a/datadog/dogstatsd/base.py b/datadog/dogstatsd/base.py index 1d39b5b99..8c72e089b 100644 --- a/datadog/dogstatsd/base.py +++ b/datadog/dogstatsd/base.py @@ -282,6 +282,9 @@ def _send_to_server(self, packet): try: # If set, use socket directly (self.socket or self.get_socket()).send(packet.encode(self.encoding)) + except socket.timeout: + # dogstatsd is overflowing, drop the packets (mimicks the UDP behaviour) + return except socket.error: log.info("Error submitting packet, will try refreshing the socket")