Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Middleware that exposes metric for logging in the context of a user
JavaScript
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
test
.gitignore
.travis.yml
README.md
index.js
package.json

README.md

connect-metric Build Status

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

Usage

var app = express()
  , metric = require("connect-metric");

app.use(metric());

app.get("/", function(req, res){
  req.metric("home_page", 1, "views"); // measure=home_page val=1 units=views
});

Options

metric(context, options);

context

The metric logger can inherit context

app.use(metric({foo: "bar"}));

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

options

options.request_id

Header name that provides a request id.

Something went wrong with that request. Please try again.