Comments (11)
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 :)
from prometheus-query-js.
Hi @omerlh
Can you tell me more about this issue, please?
I didn't find any information about such a requirement.
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?
- reference to a Prometheus Github issue?
- some error message?
Thanks for your help ;)
(FYI, unexpected_error
may be inserted into response by the library itself =>
prometheus-query-js/src/driver.ts
Line 111 in 8c4a601
from prometheus-query-js.
I am using NodeJS. Not using proxy, but using kubectl port-forward
to access prom - not sure if related...
from prometheus-query-js.
kubectl port-forward
is a simple tcp proxy. I don't expect any error here.
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.
from prometheus-query-js.
Nope, this was very reproducible: as long as gzip encoding is not set, it was broken. Once I added it, it was solved...
from prometheus-query-js.
fixed v3.0.1
from prometheus-query-js.
hi @omerlh,
Since setting the Accept-Encoding header is forbidden, I wonder what browser are you using?
Looks like browsers automatically set this header.
from prometheus-query-js.
I am not using a browser... The code I wrote was running in nodeJS
from prometheus-query-js.
This is really weird. I cannot reproduce your error.
Can you start a local Prometheus instance ? docker run --rm -it -p 9090:9090 prom/prometheus:v2.25.0
Then: npx ts-node examples/nodejs/app.ts
(replace the hostname at the top of the file)
I upgraded Axios yesterday. Can you try again please?
from prometheus-query-js.
I get the same problem with my "proxy" I made for my API, all I did was add the Authorization
header to my user's access token. Works fine in curl but fails with the error message described here.
from prometheus-query-js.
I might have a solution, it just needs to be verified. You just need to append this to your PrometheusDriver
configuration:
{
requestInterceptor: {
onFulfilled: (cfg) => ({
...cfg,
responseType: 'json',
decompress: false
})
}
}
from prometheus-query-js.
Related Issues (15)
- Does this package support Request interceptor? HOT 2
- Refused to set unsafe header "Accept-Encoding" HOT 3
- Use HTTPS-capable prometheus.demo.do.prometheus.io in examples HOT 1
- alerts() returns undefined for state HOT 1
- Errors of Prometheus are not handled HOT 2
- link github on npm HOT 1
- Incompatible with node v17 HOT 5
- Add support for data push HOT 1
- String parameter for rangeQuery step? HOT 2
- add support for jwt-token HOT 1
- Username/password in auth parameter not used
- Add more details to `unexpected client error` error handling HOT 4
- How to set the rate interval in the PROMQL similar to $__rate_interval by grafana. HOT 3
- Typescript support? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from prometheus-query-js.