Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pushgateway doRequest throws IO exception with http 200 response #517

Closed
zyxmn-rvu opened this issue Dec 15, 2019 · 12 comments
Closed

Pushgateway doRequest throws IO exception with http 200 response #517

zyxmn-rvu opened this issue Dec 15, 2019 · 12 comments

Comments

@zyxmn-rvu
Copy link

zyxmn-rvu commented Dec 15, 2019

Hello,

I always get the following IO Exception when I push metrics to the pushgateway. The exception message is as follows.

IOException Response code from http://localhost:9091/metrics/job/job_name/instance/localhost was 200  io.prometheus.client.exporter.PushGateway.doRequest (PushGateway.java:273)

I noticed there was a recent change on the checking of the response code here ddf03f1#diff-03479f39aa27f4338f7e985625fd388e.

I am unclear how to diagnose this at the moment. Are there scenarios where we can get an IO exception for a 200 http response in this context ?

Thanks!

@brian-brazil
Copy link
Contributor

What version of the Java client are you using?

@zyxmn-rvu
Copy link
Author

Hi, I am using a clojure wrapper . Here is the link to the version .https://github.com/soundcloud/prometheus-clj/blob/master/project.clj#L11 . Seems to be 0.0.14

@brian-brazil
Copy link
Contributor

You need 0.18.0.

@zyxmn-rvu
Copy link
Author

I am assuming that was a mistype? Do you mean 0.0.18 or 0.8.0

@brian-brazil
Copy link
Contributor

brian-brazil commented Dec 16, 2019 via email

@brian-brazil
Copy link
Contributor

Did 0.8.0 resolve this for you?

@namsoo2
Copy link

namsoo2 commented Jun 29, 2020

I am using 0.9.0 and have the same problem.

errorCode: Response code from http://localhost:9091/metrics/job/service/phase/real/host/batch001 was 200

Exception: java.io.IOException: Response code from http://localhost:9091/metrics/job/service/phase/real/host/batch001 was 200
at io.prometheus.client.exporter.PushGateway.doRequest(PushGateway.java:325)
at io.prometheus.client.exporter.PushGateway.pushAdd(PushGateway.java:182)
at org.springframework.boot.actuate.metrics.export.prometheus.PrometheusPushGatewayManager.push(PrometheusPushGatewayManager.java:108)
at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305)
at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:834)
Location: org.springframework.boot.actuate.metrics.export.prometheus.PrometheusPushGatewayManager.push():119

image

@brian-brazil
Copy link
Contributor

I'm not seeing how the code can get there with a 200. Does the data end up in the pushgateway as expected?

@namsoo2
Copy link

namsoo2 commented Jun 30, 2020

@brian-brazil
Yes, pushgateway contains all the data as expected.
Let me know if you need any information.

@namsoo2
Copy link

namsoo2 commented Jun 30, 2020

@brian-brazil
In my project's gradle I set it as below
compile("io.prometheus:simpleclient_pushgateway")
And when confirmed by Intellij, it was 0.9.0.
So I was convinced that it was 0.9.0.
However, when I analyzed the built jar, it was 0.7.0.
I solved the problem by writing the version as below.
compile("io.prometheus:simpleclient_pushgateway:0.9.0")
Thank you.

@brian-brazil
Copy link
Contributor

Okay, so using the older version then was the issue.

@javaDer
Copy link

javaDer commented Jul 29, 2020

oh yes , Yes, I use 0.9.0 , problem solving
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants