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

Added response_timeout property to prometheus input plugin #2006

Closed
wants to merge 2 commits into from
Closed

Added response_timeout property to prometheus input plugin #2006

wants to merge 2 commits into from

Conversation

puckpuck
Copy link
Contributor

@puckpuck puckpuck commented Nov 7, 2016

Required for all PRs:

  • CHANGELOG.md updated (we recommend not updating this until the PR has been approved by a maintainer)
  • Sign CLA (if not already signed)
  • README.md updated (if adding a new plugin)

While working with a customer to setup monitoring, leveraging their existing Prometheus endpoints to gather metrics, we were getting numerous timeout errors in the logs. Upon further investigation, the prometheus input plugin has a 3 second timeout hard coded. The issue is that some of the prometheus endpoints were taking much longer than 3 seconds to return all available metrics. We converted this to a configuration property, with a default value of 3 seconds, which ultimately solved the problem.

Since the default is still 3 seconds, this should be a non-breaking change.

@puckpuck puckpuck changed the title Added response_timeout property Added response_timeout property to prometheus input plugin Nov 7, 2016
@puckpuck puckpuck added this to the 1.2.0 milestone Nov 7, 2016
@@ -21,6 +21,8 @@ type Prometheus struct {
// Bearer Token authorization file path
BearerToken string `toml:"bearer_token"`

ResponseTimeout int `toml:"response_timeout"`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make ResponseTimeout an internal.Duration type

@@ -38,6 +40,9 @@ var sampleConfig = `
## Use bearer token for authorization
# bearer_token = /path/to/bearer/token

## Specify timeout in seconds for slower prometheus clients (default is 3)
# response_timeout = 3
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

once ResponseTimeout is an internal.Duration type, it can be written as response_timeout = "3s"

@sparrc sparrc closed this in f09c08d Dec 17, 2016
@puckpuck puckpuck deleted the prometheus-timeout branch December 21, 2016 18:50
njwhite pushed a commit to njwhite/telegraf that referenced this pull request Jan 31, 2017
maxunt pushed a commit that referenced this pull request Jun 26, 2018
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

Successfully merging this pull request may close these issues.

2 participants