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

prom-client 11.2.0 breaks middleware #22

Closed
peterkuiper opened this issue Dec 7, 2018 · 2 comments
Closed

prom-client 11.2.0 breaks middleware #22

peterkuiper opened this issue Dec 7, 2018 · 2 comments

Comments

@peterkuiper
Copy link

peterkuiper commented Dec 7, 2018

When running the latest version of prom-client these metrics disappear:

# HELP up 1 = up, 0 = not up
# TYPE up gauge
up 1

# HELP http_request_duration_seconds duration histogram of http responses labeled with: status_code, method, path
# TYPE http_request_duration_seconds histogram

I haven't had the time to figure out what is new in prom-client. I have set the version to 11.1.3 as a quick fix.

@disjunction
Copy link
Collaborator

hm, that's unfortunate. Minor versions should normally be backwards-compatible, and this lib is quite straight-forward in what it does. Thanks for reporting it!

@disjunction
Copy link
Collaborator

I couldn't reproduce this problem. It works fine for me.

I suspect there is a misunderstanding. Bare in mind: express-prom-bundle has a direct dependency on prom-client. When you were testing it it was ~11.1.2, thus you COULD NOT use 11.2.0 at all unless you meddled with the library. Since today release I upgraded the dependency to ~11.2.1

If you have prom-client@11.2.0 installed in your app separately, then in your app you actually have 2 different prom-client instances, one which came with express-prom-bundle, and another - your own. They don't share the metrics, so it might be you were collecting the data with one client, while trying to read from another one.

Until now you could use a workaround: instead of installing and requiring prom-client, you could directly access the one, coming with express-prom-bundle as follows:

const promClient = require('express-prom-bundle').promClient

With the new release 5.x prom-client will become a peer dependency and you won't have this problem again.

Please reopen if my guess is wrong and you still experience the problem, in which case I'd need some reproducible test case.

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

No branches or pull requests

2 participants