me-ventures / microservice-toolkit

MIT License
3 stars 1 forks source link

expose additional StatsD methods in toolkit metrics #5

Open EvaLok opened 7 years ago

EvaLok commented 7 years ago

stuff like count, decrement and so might be handy for more accurate metrics

MaikelH commented 7 years ago

We should definitely be looking into exposing more options. We should make a list of all the different methods and see what we can implement. I think most of the stuff should be pretty easy to implement.

EvaLok commented 7 years ago

yep i think so too; we could also consider adding a "native" (or something like this) export on the metrics so that library-specific-but-not-universal methods can be accessed. something like:

var metrics = require('microservice-toolkit').metrics.native;

metrics.someRandomMethod('stuff');

what do you think?

EvaLok commented 7 years ago

..of course i guess this only applies once we want to use other libraries for metrics

MaikelH commented 7 years ago

Exposing the internal metrics could be dangerous, since it can easily break. The underlying library can be changed or a different metrics back-end is loaded and all your code breaks.

EvaLok commented 7 years ago

that certainly could happen; i was more thinking that it might be a nice way to stay as unopinionated as possible, since presumably if someone wants access to the native methods, they would be locking in the toolkit version and aware enough of their configuration situation that this wouldn't be a problem. in any case, even if we were to decide to do it, it's definitely not high priority compared to simply exposing some common methods, just wanted to consider it ;)