mozilla-services / cliquet

CLIQUET IS NOW DEPRECATED use kinto.core instead
http://github.com/Kinto/kinto
Other
64 stars 16 forks source link

Provide a way to override or extend the Statsd module #643

Closed linusthe3rd closed 8 years ago

linusthe3rd commented 8 years ago

It would be nice if consumers of cliquet could override or wrap the statsd module so they can use a different statsd implementation (such as datadog) or inject their own metadata into statsd calls.

For example, in my use case, we utilize datadog to track our metrics, which is compliant with the statsd protocol, but extends the API to introduce the concept of "tags". My team uses tags to inject extra metadata into metrics, such as values pulled in from custom internal HTTP headers.

It would be nice if I could modify the statsd module to utlize datadog and extend the logic to automatically inject other metadata into the metric.

Natim commented 8 years ago

Hello @strife25, thank you for your issue.

First, pluggability like that is totally within the scope of Kintocliquet. We did it for the cache backends, the permissions backends and the storage backends so if you need it we can do it for the stats backend.

The code is almost ready for it: https://github.com/mozilla-services/cliquet/blob/master/cliquet/statsd.py

We would need to:

Can you show us an example of how you use tags? Would tags be something like the bucket/collection and record IDs ?

leplatrem commented 8 years ago

@Natim you can see how @tarekziade used tags in https://github.com/mozilla-services/absearch/pull/19/files

I would definitely be in favor modularizing a bit the code from cliquet.statsd to specify it from configuration.

Natim commented 8 years ago

Ok that's nice also we need to agree on the tags we want for Kinto right?

tarekziade commented 8 years ago

@strife25 moved the discussion to Kinto