Skip to content

Commit f81dd6e

Browse files
authored
Update README.md
1 parent bca4af9 commit f81dd6e

File tree

1 file changed

+15
-19
lines changed

1 file changed

+15
-19
lines changed

README.md

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@ prometheus = Prometheus::ApiClient.client
2525

2626
prometheus.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
5959
prometheus.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
6868
prometheus.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
111109
prometheus.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
137133
prometheus.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

Comments
 (0)