Giter Club home page Giter Club logo

Comments (11)

omerlh avatar omerlh commented on May 30, 2024 1

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.

samber avatar samber commented on May 30, 2024

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 =>

errorType: 'unexpected_error',

from prometheus-query-js.

omerlh avatar omerlh commented on May 30, 2024

I am using NodeJS. Not using proxy, but using kubectl port-forward to access prom - not sure if related...

from prometheus-query-js.

samber avatar samber commented on May 30, 2024

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.

omerlh avatar omerlh commented on May 30, 2024

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.

samber avatar samber commented on May 30, 2024

fixed v3.0.1

from prometheus-query-js.

samber avatar samber commented on May 30, 2024

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.

omerlh avatar omerlh commented on May 30, 2024

I am not using a browser... The code I wrote was running in nodeJS

from prometheus-query-js.

samber avatar samber commented on May 30, 2024

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.

RossComputerGuy avatar RossComputerGuy commented on May 30, 2024

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.

RossComputerGuy avatar RossComputerGuy commented on May 30, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.