Skip to content

Commit aa5e553

Browse files
committed
set readme
1 parent da8ffdc commit aa5e553

1 file changed

Lines changed: 11 additions & 5 deletions

File tree

README.md

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

2626
prometheus.get(
2727
"query_range",
28-
:query => "sum(container_cpu_usage_seconds_total{container_name=\"prometheus-hgv4s\",job=\"kubernetes-nodes\"})",
28+
:query => "sum(container_cpu_usage_seconds_total" \
29+
"{container_name=\"prometheus-hgv4s\",job=\"kubernetes-nodes\"})",
2930
:start => "2015-07-01T20:10:30.781Z",
3031
:end => "2015-07-02T20:10:30.781Z",
3132
:step => "120s"
@@ -41,11 +42,13 @@ prometheus = Prometheus::ApiClient.client(url: 'http://example.com:9090')
4142

4243
#### Authentication proxy
4344

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+
If an authentication proxy ( e.g. oauth2 ) is used in a layer above the
46+
prometheus REST server, this client can use ssl and authentication headears.
4547

4648
```ruby
4749
# return a client for host https://example.com/api/v1/ using a Bearer token "TopSecret"
48-
prometheus = Prometheus::ApiClient.client(url: 'https://example.com:443', credentials: {token: 'TopSecret'})
50+
prometheus = Prometheus::ApiClient.client(url: 'https://example.com:443',
51+
credentials: {token: 'TopSecret'})
4952
```
5053

5154
#### High level calls
@@ -54,13 +57,15 @@ prometheus = Prometheus::ApiClient.client(url: 'https://example.com:443', creden
5457

5558
# send a query request to server
5659
prometheus.query(
57-
:query => "sum(container_cpu_usage_seconds_total{container_name=\"prometheus-hgv4s\",job=\"kubernetes-nodes\"})",
60+
:query => "sum(container_cpu_usage_seconds_total" \
61+
"{container_name=\"prometheus-hgv4s\",job=\"kubernetes-nodes\"})",
5862
:time => "2015-07-01T20:10:30.781Z",
5963
)
6064

6165
# send a query_range request to server
6266
prometheus.query_range(
63-
:query => "sum(container_cpu_usage_seconds_total{container_name=\"prometheus-hgv4s\",job=\"kubernetes-nodes\"})",
67+
:query => "sum(container_cpu_usage_seconds_total" \
68+
"{container_name=\"prometheus-hgv4s\",job=\"kubernetes-nodes\"})",
6469
:start => "2015-07-01T20:10:30.781Z",
6570
:end => "2015-07-02T20:10:30.781Z",
6671
:step => "120s"
@@ -85,6 +90,7 @@ prometheus.query(
8590
:query => "sum(container_cpu_usage_seconds_total)",
8691
:time => "2015-07-01T20:10:30.781Z",
8792
)
93+
```
8894

8995
## Tests
9096

0 commit comments

Comments
 (0)