diff --git a/notifications_utils/clients/statsd/statsd_client.py b/notifications_utils/clients/statsd/statsd_client.py index a2fdb502..2f53dcd1 100644 --- a/notifications_utils/clients/statsd/statsd_client.py +++ b/notifications_utils/clients/statsd/statsd_client.py @@ -48,6 +48,16 @@ def gauge(self, stat, count): if self.active: self.statsd_client.gauge(self.format_stat_name(stat), count) + def histogram(self, stat, value, rate=1): + """This is a DataDog specific method, which sends a histogram value to statsd. A statsd packet + is a packet with this format - :||@. + For a histogram, the metric type is 'h'. + + reference: https://github.com/DataDog/datadogpy/blob/master/datadog/dogstatsd/base.py#L950 + """ + if self.active: + self.statsd_client._send_stat(self.format_stat_name(stat), '%s|h' % value, rate) + def timing(self, stat, delta, rate=1): if self.active: self.statsd_client.timing(self.format_stat_name(stat), delta, rate) diff --git a/notifications_utils/version.py b/notifications_utils/version.py index 05633ca0..83b6ab02 100644 --- a/notifications_utils/version.py +++ b/notifications_utils/version.py @@ -1 +1 @@ -__version__ = '2.2.3' +__version__ = '2.2.4'