Comments (5)
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.
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.
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.
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.
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)
- NRI-Prometheus not compatible with Open Metrics 1.0.0 / Spring-Boot HOT 4
- Prometheus Config using values from Parent Chart HOT 3
- Adding support for custom label value in addition to scrape_enabled_label HOT 1
- Nri-prometheus scraping and parsing issue HOT 7
- rename_attributes transformation is not renaming attribute HOT 1
- Prometheus still scraping services after setting scrape_services = false HOT 3
- Ignore all metrics except set of metrics HOT 3
- ignore_metrics not always working HOT 6
- Transformations.add_attributes.attributes does not maintain case HOT 2
- [Repolinter] Open Source Policy Issues HOT 1
- Add support for targets over DNS, like dns_sd_config in Prometheus HOT 5
- Pod metrics don't get correlated properly to infrastructure entities HOT 3
- [Repolinter] Open Source Policy Issues HOT 1
- Dependency Dashboard
- [Repolinter] Open Source Policy Issues HOT 1
- Dropping metrics HOT 2
- Ignore metrics partially works HOT 1
- Support regex in ignore_metrics HOT 1
- NRI Prometheus using enormous amounts of resources 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 nri-prometheus.