roylines / node-epimetheus

node middleware to automatically instrument node applications for consumption by prometheus
MIT License
85 stars 45 forks source link

/metrics endpoint throws 404 #50

Closed rvillane closed 6 years ago

rvillane commented 6 years ago

Using epimetheus v1.0.55 with hapi 16.6.3 but /metrics endpoint is not really getting exposed, got a 404. Is this expected ?

const Hapi = require('hapi');
const epithemeus = require('epimetheus');

const server = new Hapi.Server();
const connection = server.connection({ port: 8080, labels: ['api'] });
epithemeus.instrument(server);

.........

// routes
connection.route({
    method: 'GET',
    path: '/',
    handler: (request, reply) => { reply(); },
});

connection.route({
    method: 'GET',
    path: '/flags',
    handler: (request, reply) => { reply(featureFlag.listFlags()); },
});

connection.route({
    method: 'POST',
    path: '/foo',
    handler: foo,
});
rvillane commented 6 years ago

embarrassing, I was sending the request using POST , not GET, is working as expected