diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-08-25 03:10:16 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-08-25 03:10:16 +0300 |
commit | 06528399ad1a7fd6a08d79bb54b656a595050d7e (patch) | |
tree | e927a1a41521f54afa5df23c555646f5fe46bd24 /app/models/concerns/prometheus_adapter.rb | |
parent | 39a4ea6124066f2209829899e6c1afe247304c91 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models/concerns/prometheus_adapter.rb')
-rw-r--r-- | app/models/concerns/prometheus_adapter.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/app/models/concerns/prometheus_adapter.rb b/app/models/concerns/prometheus_adapter.rb index adb6a59e11c..55c2bf96a94 100644 --- a/app/models/concerns/prometheus_adapter.rb +++ b/app/models/concerns/prometheus_adapter.rb @@ -3,6 +3,11 @@ module PrometheusAdapter extend ActiveSupport::Concern + # We should choose more conservative timeouts, but some queries we run are now busting our + # default timeouts, which are stricter. We should make those queries faster instead. + # See https://gitlab.com/gitlab-org/gitlab/-/issues/232786 + DEFAULT_PROMETHEUS_REQUEST_TIMEOUT_SEC = 60.seconds + included do include ReactiveCaching @@ -15,6 +20,12 @@ module PrometheusAdapter raise NotImplementedError end + def prometheus_client_default_options + { + timeout: DEFAULT_PROMETHEUS_REQUEST_TIMEOUT_SEC + } + end + # This is a light-weight check if a prometheus client is properly configured. def configured? raise NotImplemented |