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

http_listener_v2 confuses prometheus clients by responding with HTTP status code 204 #15453

Closed
yacoob opened this issue Jun 4, 2024 · 1 comment · Fixed by #15454
Closed
Labels
bug unexpected problem or unintended behavior

Comments

@yacoob
Copy link

yacoob commented Jun 4, 2024

Relevant telegraf.conf

[[inputs.http_listener_v2]]
  service_address = "127.0.0.1:9999"
  paths = ["/metrics/job/home.backup"]
  data_format = "prometheus"

Logs from Telegraf

n/a

System info

Telegraf 1.30.3 (git: HEAD@fd4af886)

Docker

No response

Steps to reproduce

  1. Configure http listener expecting prometheus input (aka prometheus push gateway lookalike)
  2. Push to it with a client using official golang prometheus client - in my case it's resticprofile

Expected behavior

Metrics are pushed without an error.

Actual behavior

With resticprofile, I get:

unexpected status code 204 while pushing to http://localhost:9999/metrics/job/home.backup:

Official golang client considers the push a success if the client receives status 200 or 202. Telegraf replies with 204, so the push is considered a failure (as in, an Error object is returned from Pusher.push(). FWIW, the metrics do go through. resticprofile also treats this as a warning, not a failure.

Additional info

No response

@yacoob yacoob added the bug unexpected problem or unintended behavior label Jun 4, 2024
powersj added a commit to powersj/telegraf that referenced this issue Jun 4, 2024
@powersj
Copy link
Contributor

powersj commented Jun 4, 2024

#15454

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug unexpected problem or unintended behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants