prometheus_parser 0.2.2 → 0.2.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_parser.rb +10 -2
- data/prometheus_parser.gemspec +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: 9fd667b3e6839cb3ee8a7d9a0e753d84dfd6ef38e9fe89e5f900bb0b632b6160
|
4
|
+
data.tar.gz: 615fd3c1911e45ce0efe38e00b9008fdad33cacb31b24be8aa983f3c48f83862
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e060324842884e9d481e86d6a6ab4beec97fc5af9dba0b65c1b1b3ad96434ba38ca95f5c7ba7f724975569cd0c8b51a2bde7166edc40cbc48f7695114f0c195c
|
7
|
+
data.tar.gz: 3315c6fb19d9ed85304c66d96a02a92ef9718678059c0ad7882c77f682da8b620bae0c51afe136f2af9e88425b09b112626e7e5d3a2431f2e7cd2b078d21e4ce
|
data/lib/prometheus_parser.rb
CHANGED
@@ -6,7 +6,7 @@ class PrometheusParser
|
|
6
6
|
end
|
7
7
|
|
8
8
|
KEY_RE = /[\w:]+/
|
9
|
-
VALUE_RE = /-?\d+\.?\d*E?-?\d*|NaN/
|
9
|
+
VALUE_RE = /-?\d+\.?\d*E?-?\d*|NaN|unknown/
|
10
10
|
ATTR_KEY_RE = /[ \w-]+/
|
11
11
|
ATTR_VALUE_RE = /\s*"([^"\\]*(\\.[^"\\]*)*)"\s*/ # /\s*"(\S*)"\s*/
|
12
12
|
|
@@ -20,8 +20,16 @@ class PrometheusParser
|
|
20
20
|
end
|
21
21
|
key = s.scan KEY_RE
|
22
22
|
raise Invalid unless key
|
23
|
-
|
23
|
+
begin
|
24
|
+
attrs = parse_attrs(s)
|
25
|
+
rescue Invalid
|
26
|
+
s.scan(/.*\n/)
|
27
|
+
next
|
28
|
+
end
|
24
29
|
value = s.scan VALUE_RE
|
30
|
+
# Workaround for faulty RabbitMQ metrics exporter
|
31
|
+
# https://github.com/rabbitmq/rabbitmq-server/discussions/5143
|
32
|
+
value = "NaN" if value == "unknown"
|
25
33
|
raise Invalid unless value
|
26
34
|
value = value.to_f
|
27
35
|
s.scan(/\n/)
|
data/prometheus_parser.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: prometheus_parser
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Magnus Landerblom
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-06-21 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description:
|
14
14
|
email: mange@84codes.com
|