Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-12-06 06:08:02 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2019-12-06 06:08:02 +0300
commited73d4f207ef6cb8646719baa1188d096c9f3139 (patch)
treedea7ab9906154c73204a0361163e30500f929d44 /app/models/concerns/prometheus_adapter.rb
parent2349eabc1a473bfb70555f0ce6d3d808cecb181d (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.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/app/models/concerns/prometheus_adapter.rb b/app/models/concerns/prometheus_adapter.rb
index 9df77b565da..99da8b81398 100644
--- a/app/models/concerns/prometheus_adapter.rb
+++ b/app/models/concerns/prometheus_adapter.rb
@@ -16,6 +16,14 @@ module PrometheusAdapter
raise NotImplementedError
end
+ # This is a light-weight check if a prometheus client is properly configured.
+ def configured?
+ raise NotImplemented
+ end
+
+ # This is a heavy-weight check if a prometheus is properly configured and accesible from GitLab.
+ # This actually sends a request to an external service and often it could take a long time,
+ # Please consider using `configured?` instead if the process is running on unicorn/puma threads.
def can_query?
prometheus_client.present?
end