connect-metric

Middleware that exposes metric for logging in the context of a user

connect-metric

Middleware that exposes metric for logging in the context of a request

var app = express()
  , metric = require("connect-metric");
 
app.use(metric());
 
app.get("/", function(reqres){
  req.metric("home_page", 1, "views"); // measure=home_page val=1 units=views 
});
metric(context, options);

The metric logger can inherit context

app.use(metric({foo: "bar"}));
 
app.get("/", function(reqres){
  req.metric("home_page", 1, "views"); // foo=bar measure=home_page val=1 units=views 
});

Header name that provides a request id.