prometheus-api-client 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6fa60b4ccdbfed4c2141142a9588169498b2b403
4
- data.tar.gz: 9033f3fc05d7beffcb794ddf427fb12b458ce187
3
+ metadata.gz: 7a557e4448ade4360c97b1467ccf8a5afc23c244
4
+ data.tar.gz: 255437c66a4bfbc9b5129519234006b44536b1b3
5
5
  SHA512:
6
- metadata.gz: 4bc1d913b47c48321189a7cd8d1d085f9f156d000735665a85aac89f1a26b1acb7b8638fad267bb40a9b671258f34b0f5fc32f1ccf1d72b85b8b94268e264ffb
7
- data.tar.gz: 951b1b31db41c3152704eef094545578f0cb714067f4bfcdd8666d1998a5d742600b428e41b6ccc329754b2f3cdc1f46f971679ade1ad994855afae8836ef31f
6
+ metadata.gz: 3b1463359dae9bbbde9c7ceff7a23db40f03d92a9c6b30d33a80fcfaccf76560038acbbad48858b229e03f61f1f93041582c037269a373be58642ea59ac4fd9b
7
+ data.tar.gz: 149728f4c861090bdbeda63d7356708743803269861aa3448207d281b8391f74c335aaa39b1d098b84b9057885bc09032fdb9ad36de1e477efc1a8215934c319
data/README.md CHANGED
@@ -36,7 +36,7 @@ prometheus.get(
36
36
 
37
37
  ```ruby
38
38
  # return a client for host http://example.com:9090/api/v1/
39
- prometheus = Prometheus::ApiClient.client('example.com')
39
+ prometheus = Prometheus::ApiClient.client('http://example.com:9090')
40
40
  ```
41
41
 
42
42
  #### Authentication proxy
@@ -44,10 +44,32 @@ prometheus = Prometheus::ApiClient.client('example.com')
44
44
  If an authentication proxy ( e.g. oauth2 ) is used in a layer above the prometheus REST server, this client can use ssl and authentication headears.
45
45
 
46
46
  ```ruby
47
- # return a client for host https://example.com/api/v1/
48
- prometheus = Prometheus::ApiClient.client('example.com', scheme: 'https', port: 443)
47
+ # return a client for host https://example.com/api/v1/ using a Bearer token "TopSecret"
48
+ prometheus = Prometheus::ApiClient.client('https://example.com:443', credentials: {token: 'TopSecret'})
49
49
  ```
50
50
 
51
+ #### High level calls
52
+
53
+ ```ruby
54
+
55
+ # send a query request to server
56
+ prometheus.query(
57
+ :query => "sum(container_cpu_usage_seconds_total{container_name=\"prometheus-hgv4s\",job=\"kubernetes-nodes\"})",
58
+ :start => "2015-07-01T20:10:30.781Z",
59
+ :end => "2015-07-02T20:10:30.781Z"
60
+ )
61
+
62
+ # send a query_range request to server
63
+ prometheus.query_range(
64
+ :query => "sum(container_cpu_usage_seconds_total{container_name=\"prometheus-hgv4s\",job=\"kubernetes-nodes\"})",
65
+ :start => "2015-07-01T20:10:30.781Z",
66
+ :end => "2015-07-02T20:10:30.781Z",
67
+ :step => "120s"
68
+ )
69
+
70
+ # send a label request to server
71
+ prometheus.label('__name__')
72
+ ```
51
73
  ## Tests
52
74
 
53
75
  Install necessary development gems with `bundle install` and run tests with
@@ -22,7 +22,7 @@ module Prometheus
22
22
  run_command('query_range', options)
23
23
  end
24
24
 
25
- def label(tag, options)
25
+ def label(tag, options = {})
26
26
  run_command("label/#{tag}/values", options)
27
27
  end
28
28
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Prometheus
4
4
  module ApiClient
5
- VERSION = '0.1.0'
5
+ VERSION = '0.1.1'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: prometheus-api-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yaacov Zamir