HomeSoftware Heritage

Add a statsd client module

Description

Add a statsd client module

prometheus-statsd-exporter uses the datadog format for its tags, so base our
client on their Python code, with the following modifications:

  • Removed python < 3.5 compat code
  • trimmed the imports down to be a single module
  • move to time.monotonic() instead of time.time()
  • adjust some options:
    • drop unix socket connection option
    • add environment variable support for setting the statsd host and port (pulled the idea from the main python statsd module)
    • only send timer metrics in milliseconds (that's what prometheus-statsd-exporter expects)
    • drop DataDog-specific metric types (that are unsupported in prometheus-statsd-exporter)
  • made the tags a dict instead of a list (prometheus-statsd-exporter only supports tags with a value, mirroring prometheus)
  • improve unit test coverage
  • documentation cleanup

Details

Provenance
olasdAuthored on Dec 19 2018, 3:03 PM
olasdPushed on Jan 8 2019, 1:48 PM
Differential Revision
D858: Add a statsd client module
Parents
rDCORE78e9cd01e23a: Make DbTestFixture.setUp() accept and pass *args and **kwargs.
Branches
Unknown
Tags
Unknown
Build Status
Buildable 3279
Build 4224: test-and-build