prometheus_exporter 0.4.13 → 0.4.14
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG +5 -0
- data/lib/prometheus_exporter/client.rb +13 -1
- data/lib/prometheus_exporter/instrumentation.rb +1 -0
- data/lib/prometheus_exporter/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c0851cbef41df3faf274a45e60e176b3a34906209a82e280624a58fa72ad1929
|
4
|
+
data.tar.gz: d6abfafdd5178e9801df4b09bef7a0597f77549f99036423e3a4c870d6b47db2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7e538b3d2e02c1d20e5a8b4cd30a11c8bbb6f3ffb6d3630384b4e1047ba69fdde331352cbe34cffed58927051a55eac25ab2e012b79700b80ec9052b8696cc67
|
7
|
+
data.tar.gz: d3e52bfbeeaeb14c5044c5a7301370993f900a471ed0c7a2b7c1b58b3881a51f3e144e896e4d6ab011e66dabb06af6cf4cde5de8fade2091f2b557efdc8cca5d
|
data/CHANGELOG
CHANGED
@@ -7,6 +7,8 @@ module PrometheusExporter
|
|
7
7
|
|
8
8
|
class Client
|
9
9
|
class RemoteMetric
|
10
|
+
attr_reader :name, :type, :help
|
11
|
+
|
10
12
|
def initialize(name:, help:, type:, client:)
|
11
13
|
@name = name
|
12
14
|
@help = help
|
@@ -87,6 +89,16 @@ module PrometheusExporter
|
|
87
89
|
metric
|
88
90
|
end
|
89
91
|
|
92
|
+
def find_registered_metric(name, type: nil, help: nil)
|
93
|
+
@metrics.find do |metric|
|
94
|
+
type_match = type ? metric.type == type : true
|
95
|
+
help_match = help ? metric.help == help : true
|
96
|
+
name_match = metric.name == name
|
97
|
+
|
98
|
+
type_match && help_match && name_match
|
99
|
+
end
|
100
|
+
end
|
101
|
+
|
90
102
|
def send_json(obj)
|
91
103
|
payload = @custom_labels.nil? ? obj : obj.merge(custom_labels: @custom_labels)
|
92
104
|
send(@json_serializer.dump(payload))
|
@@ -128,8 +140,8 @@ module PrometheusExporter
|
|
128
140
|
sleep 0.001
|
129
141
|
end
|
130
142
|
@worker_thread = nil
|
131
|
-
end
|
132
143
|
close_socket!
|
144
|
+
end
|
133
145
|
end
|
134
146
|
|
135
147
|
private
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: prometheus_exporter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.14
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sam Saffron
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-10-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rubocop
|