question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

accept-encoding: identity should be accepted

See original GitHub issue

Describe the bug

using vector to scrap /metrics for scraping keycloak metrics. but keycloak refused to response.

as I reported to vector and I got response

According to the HTTP spec here: https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html

      4. The "identity" content-coding is always acceptable, unless
         specifically refused because the Accept-Encoding field includes
         "identity;q=0", or because the field includes "*;q=0" and does
         not explicitly include the "identity" content-coding. If the
         Accept-Encoding field-value is empty, then only the "identity"
         encoding is acceptable.
The identity encoding (as you indicate Vector is sending) MUST be acceptable by any remote server. 

Version

18.0

Expected behavior

it should report metric with header “accept-encoding: identity”

Actual behavior

curl -v -H "Accept:" -H "accept-encoding: identity" http://localhost:8080/metrics
* About to connect() to localhost port 8080 (#0)
*   Trying 127.0.0.1...
* Connected to localhost (127.0.0.1) port 8080 (#0)
> GET /metrics HTTP/1.1
> User-Agent: curl/7.29.0
> Host: localhost:8080
> accept-encoding: identity
>
< HTTP/1.1 406 Not Acceptable
< content-length: 69
<
* Connection #0 to host localhost left intact
* 

How to Reproduce?

No response

Anything else?

reported to vector github

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

3reactions
pedroigorcommented, May 26, 2022

OK, I’m convinced 😃

However, this issue is related to how SmallRye Metrics works and we should be talking with them about this behavior.

Created https://github.com/smallrye/smallrye-metrics/issues/497.

2reactions
pedroigorcommented, Aug 4, 2022

Closing as it should be fixed once we upgrade Quarkus.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Accept-Encoding - HTTP - MDN Web Docs
The Accept-Encoding request HTTP header indicates the content encoding (usually a compression algorithm) that the client can understand.
Read more >
Some servers seem to expect 'Accept-Encoding : identity' to ...
I'm going through some URLs, and yes, there are some that will only return a range if Accept-Encoding is absent, or indicates 'identity'....
Read more >
Accept-Encoding HTTP Header: Principles, Types, Working ...
The Accept-Encoding HTTP request header determines the content compression algorithm that will be accepted. Accept-Encoding HTTP Header is ...
Read more >
HTTP headers | Accept-Encoding - GeeksforGeeks
identity: This directive Indicates the identity function which is always acceptable. *: This directive matches any content encoding which can be ...
Read more >
Accept-Encoding - HTTP
The Accept-Encoding request HTTP header advertises which content encoding, ... explicitly set value for identity, the server must never send back a 406....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found