Skip to content

Commit bca4af9

Browse files
committed
bump version
1 parent d05dae6 commit bca4af9

File tree

3 files changed

+51
-4
lines changed

3 files changed

+51
-4
lines changed

README.md

Lines changed: 48 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
[![Build Status][3]](https://codeclimate.com/github/yaacov/prometheus_api_client_ruby)
66
[![Coverage Status][4]](https://coveralls.io/github/yaacov/prometheus_api_client_ruby?branch=master)
77

8-
A Ruby library for reading Prometheus metrics API.
8+
A Ruby library for reading metrics stored on a Prometheus server.
99

1010
## Install
1111

@@ -61,7 +61,9 @@ prometheus.query(
6161
"{container_name=\"prometheus-hgv4s\",job=\"kubernetes-nodes\"})",
6262
:time => "2015-07-01T20:10:30.781Z",
6363
)
64+
```
6465

66+
```ruby
6567
# send a query_range request to server
6668
prometheus.query_range(
6769
:query => "sum(container_cpu_usage_seconds_total" \
@@ -70,11 +72,56 @@ prometheus.query_range(
7072
:end => "2015-07-02T20:10:30.781Z",
7173
:step => "120s"
7274
)
75+
```
7376

77+
Example of response to metrics request:
78+
```
79+
{"resultType"=>"matrix",
80+
"result"=>
81+
[{"metric"=>
82+
{"__name__"=>"container_cpu_usage_seconds_total",
83+
"beta_kubernetes_io_arch"=>"amd64",
84+
"beta_kubernetes_io_os"=>"linux",
85+
"cpu"=>"cpu00",
86+
"id"=>"/",
87+
"instance"=>"example.com",
88+
"job"=>"kubernetes-cadvisor",
89+
"kubernetes_io_hostname"=>"example.com",
90+
"region"=>"infra",
91+
"zone"=>"default"},
92+
"values"=>[[1502086230.781, "51264.830099022"],
93+
[1502086470.781, "51277.367732154"]]},
94+
{"metric"=>
95+
{"__name__"=>"container_cpu_usage_seconds_total",
96+
"beta_kubernetes_io_arch"=>"amd64",
97+
"beta_kubernetes_io_os"=>"linux",
98+
"cpu"=>"cpu01",
99+
"id"=>"/",
100+
"instance"=>"example.com",
101+
"job"=>"kubernetes-cadvisor",
102+
"kubernetes_io_hostname"=>"example.com",
103+
"region"=>"infra",
104+
"zone"=>"default"},
105+
"values"=>[[1502086230.781, "53879.644934689"],
106+
[1502086470.781, "53892.665282065"]]}]}
107+
```
108+
109+
```ruby
74110
# send a label request to server
75111
prometheus.label('__name__')
76112
```
77113

114+
Example of response to a label request:
115+
```
116+
["kubernetes-apiservers", "kubernetes-cadvisor", "kubernetes-nodes",
117+
"kubernetes-service-endpoints"]
118+
```
119+
120+
```ruby
121+
# send a targets request to server
122+
prometheus.targets()
123+
```
124+
78125
#### cAdvisor specialize client
79126

80127
```ruby

lib/prometheus/api_client/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22

33
module Prometheus
44
module ApiClient
5-
VERSION = '0.3.1'
5+
VERSION = '0.3.2'
66
end
77
end

prometheus-api-client.gemspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ require 'prometheus/api_client/version'
55
Gem::Specification.new do |s|
66
s.name = 'prometheus-api-client'
77
s.version = Prometheus::ApiClient::VERSION
8-
s.summary = 'A suite of reading metric values ' \
9-
'that are exposed through an API interface.'
8+
s.summary = 'A suite of reading metrics stored on ' \
9+
'a Prometheus server.'
1010
s.authors = ['Yaacov Zamir']
1111
s.email = ['[email protected]']
1212
s.homepage = 'https://github.com/yaacov/prometheus_api_client_ruby'

0 commit comments

Comments
 (0)