hapi-statsd icon indicating copy to clipboard operation
hapi-statsd copied to clipboard

Different identifier for increment and timing

Open xarlio opened this issue 8 years ago • 4 comments

We have some problems to visualize the metrics as increment and timing functions are called with the same identifier. Adding '.counter' and '.timer' suffixes will differentiate them

xarlio avatar Jan 26 '18 12:01 xarlio

Coverage Status

Coverage increased (+0.3%) to 96.429% when pulling cadf647bf78fa586854e2ed5d8169885cbb9c921 on xarlio:patch-1 into 031723a2c0925fcde69ebf936a1752f5d1ec3461 on mac-:master.

coveralls avatar Jan 26 '18 12:01 coveralls

Thanks for the contribution! A couple of questions:

  1. What tool are you using to visualize the metrics? From my experience, Graphite and Grafana are able to differentiate these metrics without changing the metric name.
  2. I don't have a problem with allowing a way to differentiate these by modifying the metric names, however, instead of hard-coding the .timer and .counter suffixes, can you make it configurable via options so that we don't force everyone into this convention?

mac- avatar Jan 26 '18 22:01 mac-

We are using Datadog, and AFAIK there is no way to differentiate the two metrics. I will make it optional. Any suggestion for the options names and its defaults?

xarlio avatar Jan 30 '18 11:01 xarlio

you could do something as simple as a boolean like includeMetricTypeInName as an option, and if it's true, add it like you are doing now.

mac- avatar Jan 31 '18 17:01 mac-