Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTTP incoming requests not showing #63

Open
tobespc opened this issue Mar 20, 2017 · 4 comments
Open

HTTP incoming requests not showing #63

tobespc opened this issue Mar 20, 2017 · 4 comments

Comments

@tobespc
Copy link
Member

tobespc commented Mar 20, 2017

this is for RuntimeTools/appmetrics#408

only happens when using .attach() method. Seems we need to require appmetics first then pass it into the constructor for the dashboard

var appmetrics = require('appmetrics')
var dash = require('appmetrics-dash')
var express = require("express");
var app = express();
dash.attach({appmetrics:appmetrics});

docs change required

@tobespc tobespc added the bug label Mar 20, 2017
@sam-github
Copy link
Contributor

That's interesting, I would expect it to happen for attach() or monitor() (since attach just calls monitor).

Perhap the difference is between monitor's two modes, the "create an internal express/http Server" mode, and the "replace an http Server's even listeners" mode? Attach only uses the latter, because it attaches to a pre-existing http Server, it doesn't create its own, but the example code uses the "open a second server on a second port" mode.

@sam-github
Copy link
Contributor

Also, appmetrics is generally expected to be the first module required, which makes it awkward when its required internally by appmetrics-dash, and appmetrics-dash allows an http server to be injected, which means it supports being called to late, doesn't it?

@sjanuary
Copy link
Contributor

sjanuary commented Mar 21, 2017

This is because of how the probes work (they hook into 'require' calls). With monitor we call require('http') after monitor is called (https://github.com/RuntimeTools/appmetrics-dash/blob/master/lib/appmetrics-dash.js#L115) in order to create our own http server, so yes if you pass your own server into monitor you would see the same problem and would need to work around it in the same way.

@tobespc the docs update needs to also cover calling monitor and passing in a server

@sjanuary
Copy link
Contributor

sjanuary commented Oct 3, 2017

Fixed by #72

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants