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

fix: updatre prom client due to breaking change #834

Merged
merged 1 commit into from
Mar 22, 2021
Merged

Conversation

dalehille
Copy link
Contributor

@dalehille dalehille commented Mar 22, 2021

209175e
https://github.com/siimon/prom-client/releases

If your metrics server has a line like res.send(register.metrics()), you
should change it to res.send(await register.metrics()).

The error message was:

The first argument must be of type string or an instance of Buffer, ArrayBuffer, or Array or an Array-like Object. Received an instance of PromisenameTypeErrorstackTypeError [ERR_INVALID_ARG_TYPE]: The first argument must be of type string or an instance of Buffer, ArrayBuffer, or Array or an Array-like Object. Received an instance of Promise
    at Function.from (buffer.js:330:9)
    at toBuffer (/home/node/node_modules/compression/index.js:286:14)
    at ServerResponse.end (/home/node/node_modules/compression/index.js:115:22)
    at /home/node/app/index.js:80:12
    at Layer.handle [as handle_request] (/home/node/node_modules/express/lib/router/layer.js:95:5)
    at next (/home/node/node_modules/express/lib/router/route.js:137:13)
    at Route.dispatch (/home/node/node_modules/express/lib/router/route.js:112:3)
    at Layer.handle [as handle_request] (/home/node/node_modules/express/lib/router/layer.js:95:5)
    at /home/node/node_modules/express/lib/router/index.js:281:22
    at Function.process_params (/home/node/node_modules/express/lib/router/index.js:335:12)
    at next (/home/node/node_modules/express/lib/router/index.js:275:10)
    at /home/node/node_modules/i18next-http-middleware/cjs/index.js:123:14
    at I18n.loadLanguages (/home/node/node_modules/i18next/dist/cjs/i18next.js:2247:23)
    at i18nextMiddleware (/home/node/node_modules/i18next-http-middleware/cjs/index.js:122:13)
    at Layer.handle [as handle_request] (/home/node/node_modules/express/lib/router/layer.js:95:5)
    at trim_prefix (/home/node/node_modules/express/lib/router/index.js:317:13)
    at /home/node/node_modules/express/lib/router/index.js:284:7
    at Function.process_params (/home/node/node_modules/express/lib/router/index.js:335:12)
    at next (/home/node/node_modules/express/lib/router/index.js:275:10)
    at Layer.handle [as handle_request] (/home/node/node_modules/express/lib/router/layer.js:91:12)
    at trim_prefix (/home/node/node_modules/express/lib/router/index.js:317:13)
    at /home/node/node_modules/express/lib/router/index.js:284:7

209175e
https://github.com/siimon/prom-client/releases

```
If your metrics server has a line like res.send(register.metrics()), you
should change it to res.send(await register.metrics()).

```
@dalehille dalehille merged commit efdbbbf into master Mar 22, 2021
@dalehille dalehille deleted the prom_client_fix branch March 22, 2021 18:10
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

Successfully merging this pull request may close these issues.

2 participants