Skip to content

Homer-Rivera/metrics-express

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

metrics-express

An express app to serve your segmentio/metrics as an internal API.

Installation

$ npm install metrics-express

Example

var Metrics = require('metrics');
var serve = require('metrics-express');

var metrics = Metrics()
  .every('10m', charges('stripe-key')
  .every('10m', subscriptions('stripe-key')
  .every('1d', awsBilling(accountId, key, secret, bucket, region))
  .every('10m', helpscout('helpscout-key', ['mailbox']));

express()
  .use('/', serve(metrics))
  .listen(7002);

After your server starts, you'll be able to access a list of your metrics at:

GET /

Fetch a list of all Metric keys.

image

GET /:name

Get a list of all valid Metric timestamps and values.

image

GET /:name/:timestamp

Get a Metric value at a specific timestamp.

timestamp values could be specific timestamps, or human date.js strings, like today or 2 weeks from wednesday.

image

License

MIT

About

Express server plugin for your business metrics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 95.8%
  • Makefile 4.2%