prometheus-api-client 0.6.2 → 0.6.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/prometheus/api_client/client.rb +8 -2
- data/lib/prometheus/api_client/version.rb +1 -1
- metadata +12 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6639fada6f8e5b2f4864b6761f13e55e84f626c395ec0d6c957d82e8afdd9eac
|
4
|
+
data.tar.gz: 88bdf8d1225080362fe1184474b83ce1bf4f2f71d5eb6b702a9995be6812c591
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 302dafac6952da121d06edc9e3cebd4734d39e6a236811c260715f075a13551098af228def8467bebc815875a04e70c024509bb79ae4a5e3e53758852a571b58
|
7
|
+
data.tar.gz: 38701bf9360a79280e4a0415b0e000bcae346ab62bcf482e80257ee3d75ad9291b6e514b8534a074b14f2335366fad06aea0352554e3bb75d1949a61304bc760
|
@@ -2,6 +2,7 @@
|
|
2
2
|
|
3
3
|
require 'json'
|
4
4
|
require 'faraday'
|
5
|
+
require 'faraday/net_http'
|
5
6
|
|
6
7
|
module Prometheus
|
7
8
|
# Client is a ruby implementation for a Prometheus compatible api_client.
|
@@ -38,7 +39,9 @@ module Prometheus
|
|
38
39
|
|
39
40
|
@client = Faraday.new(
|
40
41
|
faraday_options(options),
|
41
|
-
)
|
42
|
+
) do |f|
|
43
|
+
f.adapter :net_http
|
44
|
+
end
|
42
45
|
end
|
43
46
|
|
44
47
|
# Evaluates an instant query at a single point in time:
|
@@ -101,7 +104,10 @@ module Prometheus
|
|
101
104
|
def run_command(command, options)
|
102
105
|
response = get(command, options)
|
103
106
|
|
104
|
-
JSON.parse(response.body)
|
107
|
+
body = JSON.parse(response.body)
|
108
|
+
raise RequestError, body['error'] if body['status'] != 'success'
|
109
|
+
|
110
|
+
body['data']
|
105
111
|
rescue StandardError => err
|
106
112
|
raise RequestError, err.message
|
107
113
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: prometheus-api-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yaacov Zamir
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-11-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -16,21 +16,21 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 2.0.0
|
20
20
|
- - "<"
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version:
|
22
|
+
version: 3.0.0
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
26
26
|
requirements:
|
27
27
|
- - ">="
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version:
|
29
|
+
version: 2.0.0
|
30
30
|
- - "<"
|
31
31
|
- !ruby/object:Gem::Version
|
32
|
-
version:
|
33
|
-
description:
|
32
|
+
version: 3.0.0
|
33
|
+
description:
|
34
34
|
email:
|
35
35
|
- kobi.zamir@gmail.com
|
36
36
|
executables: []
|
@@ -46,7 +46,7 @@ homepage: https://github.com/yaacov/prometheus_api_client_ruby
|
|
46
46
|
licenses:
|
47
47
|
- Apache-2.0
|
48
48
|
metadata: {}
|
49
|
-
post_install_message:
|
49
|
+
post_install_message:
|
50
50
|
rdoc_options: []
|
51
51
|
require_paths:
|
52
52
|
- lib
|
@@ -54,15 +54,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
54
54
|
requirements:
|
55
55
|
- - ">="
|
56
56
|
- !ruby/object:Gem::Version
|
57
|
-
version:
|
57
|
+
version: 3.0.0
|
58
58
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
59
59
|
requirements:
|
60
60
|
- - ">="
|
61
61
|
- !ruby/object:Gem::Version
|
62
62
|
version: '0'
|
63
63
|
requirements: []
|
64
|
-
rubygems_version: 3.
|
65
|
-
signing_key:
|
64
|
+
rubygems_version: 3.5.16
|
65
|
+
signing_key:
|
66
66
|
specification_version: 4
|
67
67
|
summary: A suite of reading metrics stored on a Prometheus server.
|
68
68
|
test_files: []
|