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: return values in case of timeout #2624

Closed
LeJav opened this issue Apr 4, 2017 · 2 comments
Closed

http_response: return values in case of timeout #2624

LeJav opened this issue Apr 4, 2017 · 2 comments
Milestone

Comments

@LeJav
Copy link

LeJav commented Apr 4, 2017

It would be nice if http_response could return values in case of timeout.
For instance, timeout value (or predefined value) for response_time and a predefined code (0 for instance) for http_response_code

Instead of having:

if err != nil {
return err
}

Do something like:

if err != nil {
fields = make(map[string]interface{})
fields["response_time"] = h.ResponseTimeout.Duration.Seconds()
fields["http_response_code"] = 0
acc.AddFields("http_response", fields, tags)
return nil
}

The timeouts will then clearly appear in graphs

@phemmer
Copy link
Contributor

phemmer commented Apr 4, 2017

We should probably come up with a standard behavior for all plugins which measure response times of something, and end up timing out. We have a similar issues over at #2548 for dns_query and #1654 for the ping plugin.

@danielnelson
Copy link
Contributor

There is now a result_type field that will be set to timeout upon timeout. The http_response_code will be unset.

@danielnelson danielnelson added this to the 1.4.0 milestone Jun 7, 2017
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

3 participants