Coder Social home page Coder Social logo

Comments (5)

paologallinaharbur avatar paologallinaharbur commented on June 10, 2024 1

Hello, likely it is related to #313

To doublecheck could you check the prometheus output and tell us if you notice differences querying with:

  • No Accept header
  • Header ‘Accept: application/openmetrics-text;version=0.0.1,text/plain;version=0.0.4;q=0.5,/;q=0.1’
  • Header ’Accept: text/plain;version=0.0.4;q=1,/;q=0.1’

from nri-prometheus.

paologallinaharbur avatar paologallinaharbur commented on June 10, 2024 1

Yes I meant with curl!
No, but we are going to address this issue soon.

By the way it is possible that the output changes according to the Accept Header included in the request, this is why this test is useful. We do not need the output, just to know if that escaping sequence is present. Thanks!

from nri-prometheus.

joncolby avatar joncolby commented on June 10, 2024

Hi @paologallinaharbur - I am happy to help debug this.

How do you mean I should query the prometheus targets with these different Headers? Using curl? I probably won't notice a different in visual output, but I will do the experiment anyway. Then i will do a diff and checksum. I cannot share the complete output however. This problem happens even when there are no fields containing escape sequences \ in the prometheus metrics output, by the way.

Or is there a way to configure the nri-prometheus agent to use different headers when scraping targets?

from nri-prometheus.

joncolby avatar joncolby commented on June 10, 2024

@paologallinaharbur -

I proxied to one of our pods, then called the metrics endpoint with curl. with no accept headers , it works as expected. but with both of the other headers, I get a 406 error.

A quick google search shows that some prometheus implementations return this code if they are not expecting other Accept headers. Especially java/spring boot.

❯ curl -v -o - -H "Accept: text/plain;version=0.0.4;q=1,/;q=0.1" http://localhost:9001/metrics
*   Trying ::1...
* TCP_NODELAY set
* Connected to localhost (::1) port 9001 (#0)
> GET /prometheus HTTP/1.1
> Host: localhost:9001
> User-Agent: curl/7.64.1
> Accept: text/plain;version=0.0.4;q=1,/;q=0.1
>
< HTTP/1.1 406
< Content-Length: 0
< Date: Wed, 06 Jul 2022 12:41:16 GMT



❯ curl -v -o - -H "Accept: application/openmetrics-text;version=0.0.1,text/plain;version=0.0.4;q=0.5,/;q=0.1" http://localhost:9001/metrics
*   Trying ::1...
* TCP_NODELAY set
* Connected to localhost (::1) port 9001 (#0)
> GET /prometheus HTTP/1.1
> Host: localhost:9001
> User-Agent: curl/7.64.1
> Accept: application/openmetrics-text;version=0.0.1,text/plain;version=0.0.4;q=0.5,/;q=0.1
>
< HTTP/1.1 406
< Content-Length: 0
< Date: Wed, 06 Jul 2022 12:41:41 GMT

from nri-prometheus.

paologallinaharbur avatar paologallinaharbur commented on June 10, 2024

My bad, copying pasting the */* was transformed into */*due to markdown.

For example in my environment this returns as expected openmetrics-text

$ curl {endpoint} -H 'Accept: application/openmetrics-text;version=0.0.1,text/plain;version=0.0.4;q=0.5,*/*;q=0.1'

and this text/plain

$ curl localhost:8000 -H 'Accept: text/plain;version=0.0.4;q=0.5,*/*;q=0.1'

We have enough data to work on a fix, in the meanwhile I will close this ticket as a duplicate of #313, thanks again for reporting it!

from nri-prometheus.

Related Issues (20)

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.