You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 18, 2021. It is now read-only.
In order to be able to gain more control on what is being logged, the sendStats function should be configurable.
In my case, I want to log more info than status_code and response_time.
Also, the default client Lynx exposes methods like decrement ,gauge and set that a user may want to use.
My proposal is that the lib allows me to do something like this:
varexpressStatsd=require('express-statsd')varstatsd=expressStatsd({host: 'localhost',port: 8125,sendStatus: function(req,res,client,options){varkey=req.myKey||req[options.requestKey];metrics.increment(key+'.node_test.int');metrics.decrement(key+'.node_test.int');metrics.timing(key+'.node_test.some_service.task.time',500);// time in msmetrics.gauge(key+'.gauge.one',100);metrics.set(key+'.set.one',10);}})app.use(statsd)app.get('/hello',function(req,res){req.myKey='hello'// ... snip ...})
In order to be able to gain more control on what is being logged, the
sendStatsfunction should be configurable.In my case, I want to log more info than
status_codeandresponse_time.Also, the default client
Lynxexposes methods likedecrement,gaugeandsetthat a user may want to use.My proposal is that the lib allows me to do something like this: