-
-
Notifications
You must be signed in to change notification settings - Fork 16
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
Getting unexpected_error when trying to query Prometheus #11
Comments
Hi @omerlh Can you tell me more about this issue, please? Are you using This library from a browser or into NodeJS? 🤔 Do you confirm this is not a proxy configuration in front of your prometheus server?
Thanks for your help ;) (FYI, prometheus-query-js/src/driver.ts Line 111 in 8c4a601
|
I am using NodeJS. Not using proxy, but using |
I suppose your proxy connection was broken at that time, and the lib responded with an "unexecpted_error" message. I let the issue opened, in case we have a similar bug report in the future. |
Nope, this was very reproducible: as long as gzip encoding is not set, it was broken. Once I added it, it was solved... |
fixed v3.0.1 |
hi @omerlh, Since setting the Accept-Encoding header is forbidden, I wonder what browser are you using? Looks like browsers automatically set this header. |
I am not using a browser... The code I wrote was running in nodeJS |
This is really weird. I cannot reproduce your error. Can you start a local Prometheus instance ? Then: I upgraded Axios yesterday. Can you try again please? |
TBH it has been a while since I worked on it, so I will try to find time to look into it but not promising anything :) |
I get the same problem with my "proxy" I made for my API, all I did was add the |
I might have a solution, it just needs to be verified. You just need to append this to your {
requestInterceptor: {
onFulfilled: (cfg) => ({
...cfg,
responseType: 'json',
decompress: false
})
}
} |
I just spent some time trying to figure why I cannot use this library to query my Prometheus instance.
Look like for newest Prometheus version (I'm running 2.25.2), the gzip encoding is required.
This is what worked for me:
This issue is more for future people who might face the same issue - maybe worth adding something on the readme?
The text was updated successfully, but these errors were encountered: