dogstatsd_collector

class dogstatsd_collector.DogstatsdCollector(dogstatsd, base_tags=None)[source]

A singleton for collecting DogStatsD-style metrics with tags. Collects metrics in-memory and then emits them when flush() is called. Each series (metric and all combination of tag key-value pairs) is emitted separately.

Parameters:
  • dogstatsd (datadog.dogstatsd.base.DogStatsD) – The DogStatsD object to use for emitting metrics.
  • base_tags (list) – A list of tags to be included on every metric emitted from the collector. Should be of the form [‘tag:value’, …]
SUPPORTED_DOGSTATSD_METRICS = ['histogram', 'increment']

The DogStatsD metrics supported by the collector.

flush()[source]

Flush all metrics, emitting each metric once per series (combination of tag key-value pairs).

histogram(metric, value, tags=None)[source]

Track a DogStatsD histogram metric.

increment(metric, value=1, tags=None)[source]

Track a DogStatsD counter metric.