Skip to content

Instantly share code, notes, and snippets.

@alileza
Created July 26, 2016 09:25
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alileza/41193ece58c3f641791dfbb009c61bbf to your computer and use it in GitHub Desktop.
Save alileza/41193ece58c3f641791dfbb009c61bbf to your computer and use it in GitHub Desktop.
prom-client example
var express = require('express');
var client = require('prom-client');
var server = express();
var counter = new client.Counter('push_notification', 'yaelah gitu aja ga paham', ['type']);
server.get('/send', function(req, res){
counter.inc({ type : 'android' })
res.send('sent')
})
server.get('/metrics', function(req, res) {
res.end(client.register.metrics());
});
server.listen(3000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment