zio / zio-metrics-legacy

⛔️ DEPRECATED
https://zio.github.io/zio-metrics
Apache License 2.0
56 stars 39 forks source link

Add `prefix: Option[String]` to the constructor of zio.metrics.Client (in zio-metrics-statsd module) so that (Dog)StatsDClient can mimic the behavior of the prefix/statsd_namespace param in Datadog's official client libs. #97

Closed ithinkicancode closed 3 years ago

ithinkicancode commented 3 years ago

This request comes from a user (@amirhac) on Discord channel:

Datadog's official client libs support this prefix/statsd_namespace parameter: https://docs.datadoghq.com/developers/dogstatsd/?tab=hostagent#client-instantiation-parameters https://github.com/DataDog/java-dogstatsd-client

To support this in zio-metrics-statsd,

  1. we'll need to add a parameter, prefix: Option[String], to zio.metrics.Client constuctor. Ideally the type signature should be prefix: Option[NonEmptyString] :)
  2. add prefix to all metric names. For statsD, I think it uses dot as the separator. I might be wrong.