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

Exclude /metrics route #68

Closed
piks2252 opened this issue Nov 5, 2020 · 6 comments
Closed

Exclude /metrics route #68

piks2252 opened this issue Nov 5, 2020 · 6 comments

Comments

@piks2252
Copy link

piks2252 commented Nov 5, 2020

Hello,
First of all thank you so much for this library, I appreciate you hard word,
Now i don't want to display /metrics request in my grafana dashboard, Is there any way to exclude /metrics route
I tried app.use("/((?!metrics))*", promBundle({includePath: true}));, but It blocks the /metrics and returns no route found which was the only access point (target) for my Prometheus server to access metrics data.
I just want to exclude "/metrics" path in my collection which is polluting my app's APIs.
Thanks

@disjunction
Copy link
Collaborator

Hi. The /metrics path is excluded automatically, you don't need to do anything. Have you tested it?

@gmeher
Copy link

gmeher commented Nov 5, 2020

HI @disjunction, Thanks for your quick reply. @piks2252 and me works on same team.
please find the attachment, "/metrics" is retained in my data metrics and same is being scraped by Prometheus server, which is polluting our business/app APIs.
Screen Shot 05-11-2020 at 14 26
Screen Shot 05-11-2020 at 14 26 - 2

@disjunction
Copy link
Collaborator

I'm afraid it's due to the way you use the module or a potential conflict with multiple prom clients. Could you provide the how the prom-client and express-prom-bundle are defined in your project.json and also how you call promBundle() in your app?

@disjunction
Copy link
Collaborator

... and if you do anything directly with prom-client, please mention it too

@gmeher
Copy link

gmeher commented Nov 5, 2020

Hi @disjunction ,Thanks. we were running swagger-stats as well in our Application server.
after removing, it worked fine.
It would be better If you can mention in the readme, will be helpful for others.

@piks2252
Copy link
Author

piks2252 commented Nov 5, 2020

Thanks @disjunction for your support.

@piks2252 piks2252 closed this as completed Nov 5, 2020
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

3 participants