@@ -25,11 +25,11 @@ prometheus = Prometheus::ApiClient.client
2525
2626prometheus.get(
2727 " query_range" ,
28- : query => " sum(container_cpu_usage_seconds_total" \
28+ query: " sum(container_cpu_usage_seconds_total" \
2929 " {container_name=\" prometheus-hgv4s\" ,job=\" kubernetes-nodes\" })" ,
30- : start => " 2015-07-01T20:10:30.781Z" ,
31- : end => " 2015-07-02T20:10:30.781Z" ,
32- : step => " 120s"
30+ start: " 2015-07-01T20:10:30.781Z" ,
31+ end: " 2015-07-02T20:10:30.781Z" ,
32+ step: " 120s"
3333)
3434```
3535
@@ -47,7 +47,7 @@ prometheus REST server, this client can use ssl and authentication headears.
4747
4848``` ruby
4949# return a client for host https://example.com/api/v1/ using a Bearer token "TopSecret"
50- prometheus = Prometheus ::ApiClient .client(url: ' https://example.com:443' ,
50+ prometheus = Prometheus ::ApiClient .client(url: ' https://example.com:443' ,
5151 credentials: {token: ' TopSecret' })
5252```
5353
@@ -57,25 +57,23 @@ prometheus = Prometheus::ApiClient.client(url: 'https://example.com:443',
5757
5858# send a query request to server
5959prometheus.query(
60- : query => " sum(container_cpu_usage_seconds_total" \
60+ query: " sum(container_cpu_usage_seconds_total" \
6161 " {container_name=\" prometheus-hgv4s\" ,job=\" kubernetes-nodes\" })" ,
62- : time => " 2015-07-01T20:10:30.781Z" ,
62+ time: " 2015-07-01T20:10:30.781Z" ,
6363)
6464```
6565
6666``` ruby
6767# send a query_range request to server
6868prometheus.query_range(
69- : query => " sum(container_cpu_usage_seconds_total" \
69+ query: " sum(container_cpu_usage_seconds_total" \
7070 " {container_name=\" prometheus-hgv4s\" ,job=\" kubernetes-nodes\" })" ,
71- : start => " 2015-07-01T20:10:30.781Z" ,
72- : end => " 2015-07-02T20:10:30.781Z" ,
73- : step => " 120s"
71+ start: " 2015-07-01T20:10:30.781Z" ,
72+ end: " 2015-07-02T20:10:30.781Z" ,
73+ step: " 120s"
7474)
75- ```
7675
77- Example of response to metrics request:
78- ```
76+ # response from server:
7977{" resultType" =>" matrix" ,
8078 " result" =>
8179 [{" metric" =>
@@ -109,10 +107,8 @@ Example of response to metrics request:
109107``` ruby
110108# send a label request to server
111109prometheus.label(' __name__' )
112- ```
113110
114- Example of response to a label request:
115- ```
111+ # response from server:
116112[" kubernetes-apiservers" , " kubernetes-cadvisor" , " kubernetes-nodes" ,
117113 " kubernetes-service-endpoints" ]
118114```
@@ -135,8 +131,8 @@ prometheus = Prometheus::ApiClient::Cadvisor::Node.new(
135131
136132# send a query request to server
137133prometheus.query(
138- : query => " sum(container_cpu_usage_seconds_total)" ,
139- : time => " 2015-07-01T20:10:30.781Z" ,
134+ query: " sum(container_cpu_usage_seconds_total)" ,
135+ time: " 2015-07-01T20:10:30.781Z" ,
140136)
141137```
142138
0 commit comments