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:
authorPawel Chojnacki <pawel@chojnacki.ws>2017-05-10 12:25:30 +0300
committerPawel Chojnacki <pawel@chojnacki.ws>2017-05-25 16:05:56 +0300
commit2061414054ce43aa6d53d1be3f602114e5a336d2 (patch)
treec32e83fcd76cd279171117f3ff282ef54f5308a2 /lib/gitlab/prometheus_client.rb
parent78de1c059ac588df4ba1ef352b28e5b1c6102804 (diff)
Additional metrics initial work, with working metrics listing, but without actoual metrics mesurements
Diffstat (limited to 'lib/gitlab/prometheus_client.rb')
-rw-r--r--lib/gitlab/prometheus_client.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/gitlab/prometheus_client.rb b/lib/gitlab/prometheus_client.rb
index 5b51a1779dd..f4ef4ff8ba4 100644
--- a/lib/gitlab/prometheus_client.rb
+++ b/lib/gitlab/prometheus_client.rb
@@ -29,6 +29,14 @@ module Gitlab
end
end
+ def label_values(name='__name__')
+ json_api_get("label/#{name}/values")
+ end
+
+ def series(*matches, start: 8.hours.ago, stop: Time.now)
+ json_api_get('series', 'match': matches, start: start.to_f, end: stop.to_f)
+ end
+
private
def json_api_get(type, args = {})