diff options
author | Pawel Chojnacki <pawel@chojnacki.ws> | 2017-05-10 12:25:30 +0300 |
---|---|---|
committer | Pawel Chojnacki <pawel@chojnacki.ws> | 2017-05-25 16:05:56 +0300 |
commit | 2061414054ce43aa6d53d1be3f602114e5a336d2 (patch) | |
tree | c32e83fcd76cd279171117f3ff282ef54f5308a2 /lib/gitlab/prometheus_client.rb | |
parent | 78de1c059ac588df4ba1ef352b28e5b1c6102804 (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.rb | 8 |
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 = {}) |