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 metrics error in middleware #16

Closed
ponomarevkonst opened this issue Jun 26, 2023 · 1 comment
Closed

http metrics error in middleware #16

ponomarevkonst opened this issue Jun 26, 2023 · 1 comment
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@ponomarevkonst
Copy link
Contributor

ponomarevkonst commented Jun 26, 2023

Describe the bug
If enabledMetrics.http is set to false some metrics (requestDuration, requestSize, responseSize) are still trying to be collected in middleware and it throws an error.

To Reproduce
Steps to reproduce the behavior:

  1. Create strapi app
  2. Go to app/config/plugins.js
  3. Set enabledMetrics.http to false
  4. Start the app with console npm run strapi console
  5. Check random endpoint in the browser (e.g. http://localhost:1337/admin)
  6. You will get TypeError: requestEnd is not a function in node_modules/strapi-prometheus/server/middlewares/index.js:26:9

Expected behavior
It should not throw an error and not collect any metrics.

@XanderD99 XanderD99 added bug Something isn't working good first issue Good for newcomers labels Jun 29, 2023
@XanderD99
Copy link
Owner

v1.6.0 has been released on npm with this bug fix :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants