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.

Prometheus jmx_exporter is not working with istio

See original GitHub issue

Hello,

The jmx_exporter is not working with ISTIO. When prometheus try to scrape metrics, it gets a HTTP 503 errors After some investigation, the HTTP error is throw by envoy (sidecar istio proxy embedded in the pod with the application). In the envoy log, there is the error message below:

[C11] protocol error: http/1.1 protocol error: HPE_UNEXPECTED_CONTENT_LENGTH
"GET /metrics HTTP/1.1" 503 UC 0 57 48 - "-" "Prometheus/2.3.1"

Before forward a request to the app container, envoy check the HTTP syntax. We tried to reproduce this issue with curl. After looking in prometheus source code to find the request sent, the error appears when the Accept-Encoding header is set with the gzip value.

We launch jmx_prometheus_httpserver in local to debug

$ curl -v  http://localhost:8080/metrics -H "Accept-Encoding: gzip"
*   Trying 127.0.0.1...
* TCP_NODELAY set
* Connected to localhost (127.0.0.1) port 8080 (#0)
> GET /metrics HTTP/1.1
> Host: localhost:8080
> User-Agent: curl/7.54.0
> Accept: */*
> Accept-Encoding: gzip
>
< HTTP/1.1 200 OK
< Date: Thu, 09 Aug 2018 09:15:56 GMT
< Content-encoding: gzip
< Content-length: 627
< Content-type: text/plain; version=0.0.4; charset=utf-8
< Transfer-encoding: chunked

According to the envoy error message, the issue come from the Content-length header. According to the http 1.1 spec, in the Chunked Transfer part, it specified that when a transfer-encoding is set to chunked, the content-length must be not set (https://tools.ietf.org/html/rfc7230#section-4.1.2).

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:9 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
kringolcommented, Jan 8, 2019

Any chance of a new jmx_exporter version soon including the upgrading to the new client_java (0.6.0) so that this issue can be fixed?

0reactions
varun-dacommented, Aug 28, 2019

I have since rebuilt the cluster and cannot say exactly which version of istio it was. It was one of [1.1.7, 1.1.10, 1.1.13].

Read more comments on GitHub >

github_iconTop Results From Across the Web

Re: Prometheus unable to retrieve JMX Exporter metrics when ...
I am seeing this issue with JMX Exporter 0.14.0. I have tried running it as a Java Agent and as a sidecar. I...
Read more >
Prometheus consistently fails to scrape some targets within a ...
We've got a GKE Kubernetes cluster ( v1.16.15-gke.7800 ) where Istio 1.8.3 has been installed and is managing pods from the default namespace....
Read more >
Kafka with JMX helm chart not working with Istio - Stack Overflow
From documentation what I understand is the above kafka with jmx helm chart is starting a jmx sidecar in kafka pod for exporting...
Read more >
Effortless monitoring of Java applications on Kubernetes
In this blog post we'll take a deep dive into the building blocks necessary for the operator to be able to inject a...
Read more >
BanzaiCloud Kafka Operator tour - Prune - Medium
rollingUpgradeConfig tels how many brokers can be broken at a time… another way of ... jmxImage describes the used prometheus jmx exporter agent...
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