express-generate-statsdkey (Derived from Seneca-Web-StatsD)
Adds a custom key (statsdKey) to Express request object with the current HTTP path. This key is used by express-statsd as key for the logged stats. For a HTTP POST request to /api/hello/world the key would look like hostname.env.http.post.api.hello.world.
The module takes as parameter an optional function that can modify the HTTP path.
Usage
In your express app:
var generateStatsdKey = require("express-generate-statsdkey").generateStatsdKey;
then use as middleware:
var express = require;var app =
// Optionally if you apply to a specific routeset you can set the prefix manually:
app.use;