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_response regression when not following redirects #6366

Closed
mp1409 opened this issue Sep 8, 2019 · 1 comment · Fixed by #6372
Closed

http_response regression when not following redirects #6366

mp1409 opened this issue Sep 8, 2019 · 1 comment · Fixed by #6372
Assignees
Labels
bug unexpected problem or unintended behavior regression something that used to work, but is now broken
Milestone

Comments

@mp1409
Copy link

mp1409 commented Sep 8, 2019

Relevant telegraf.conf:

[[inputs.http_response]]
  urls = ["http://<redacted>/"]
  follow_redirects = false

System info:

Distributor ID:	Debian
Description:	Debian GNU/Linux 9.10 (stretch)
Release:	9.10
Codename:	stretch
Telegraf 1.12.0 (git: HEAD 43bb6941)

Steps to reproduce:

I'm monitoring a bunch of HTTP websites that redirect to HTTPS with Grafana and Telegraf's http_response . The HTTPS websites are monitored separately, i.e. I want to monitor the redirections themselves.

Expected behavior:

Based upon the documentation (and working up to Telegraf 1.11.5), I would expect the response code to be a redirection (i.e. 301, 307), and the result code to be 0.

Actual behavior:

Since 1.12.0, the result code is still correct, but the response code is 2 (body_read_error). However, according to the docs, it should be zero.

Additional info:

Log output:

D! Network error while polling http://<redacted>/: Get https://<redacted>/: redirect
D! Failed to read body of HTTP Response : http: read on closed response body
@danielnelson danielnelson self-assigned this Sep 9, 2019
@danielnelson danielnelson added bug unexpected problem or unintended behavior regression something that used to work, but is now broken labels Sep 9, 2019
@danielnelson danielnelson added this to the 1.12.1 milestone Sep 9, 2019
@mp1409
Copy link
Author

mp1409 commented Sep 11, 2019

Works in 1.12.1, thanks!

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 regression something that used to work, but is now broken
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants