RuntimeTools / appmetrics-dash

A data visualizer that uses " Node Application Metrics" (appmetrics) to monitor and display Node.js application data as a html web application.
Other
452 stars 55 forks source link

passing in `options.url` to monitor causes dashboard not to show metrics #160

Closed ghost closed 5 years ago

ghost commented 6 years ago

Issue: Passing in a HTTP server object via options.server and a non-default url via options.url is causing the metrics dashboard to be empty.


using hapi v16

const dash = require('appmetrics-dash');
...
dash.monitor({
    server: server.select('web').listener,
    url: '/new/appdash'
});

screen shot 2018-08-29 at 1 55 00 pm


Context: there are multiple connections for this node.js app so using server.select('web').listener returns the HTTP server object for the web connection. https://github.com/hapijs/hapi/blob/v16/API.md#serverlistener


Could it be because:

io = require('socket.io')(server, { path: '/appmetrics-dash/socket.io' });

https://github.com/RuntimeTools/appmetrics-dash/blob/master/lib/appmetrics-dash.js#L171

And instead if options.url exists, setting the path to ${options.url}/socket.io?

s-h-a-d-o-w commented 5 years ago

This is the more important problem (see also my PR): https://github.com/RuntimeTools/appmetrics-dash/blob/master/public/index.html#L32

tobespc commented 5 years ago

@s-h-a-d-o-w @mannypamintuan Sorry for not having responded sooner to this, will pick this up tomorrow in the office and get back on top of the outstanding issues and PR's