prometheus-client-mmap 0.16.2 → 0.18.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +22 -10
- data/ext/fast_mmaped_file/hashmap.c +467 -410
- data/ext/fast_mmaped_file/jsmn.c +244 -259
- data/ext/fast_mmaped_file/mmap.c +58 -0
- data/ext/fast_mmaped_file/mmap.h +6 -0
- data/ext/fast_mmaped_file/value_access.c +9 -6
- data/lib/fast_mmaped_file.bundle +0 -0
- data/lib/mmap.rb +7 -0
- data/lib/prometheus/#client.rb# +58 -0
- data/lib/prometheus/client/push.rb +120 -12
- data/lib/prometheus/client/version.rb +1 -1
- metadata +6 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 28745ccfcec4f7f79be0f0d64258aecf66e19e35aaf28681bf7284833fe7adfc
|
4
|
+
data.tar.gz: 04dd8b1fa4c8f769daff34345dbd039940af4fdf3a72d9c948893ea5e1b56835
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 75188a0202b23b8845a4fd13e315ec0d98eab57034d32528292e886e684208a681579a14f199c9a40eed70fe62452dc83faf661941247cddeed5e9c89b826add
|
7
|
+
data.tar.gz: 7842632f104eadbda9a1c1733d3384aa9743dfda25c20cf98f1d0f59201900b9b3143414bfcf333e9f61c0b18e2fbe1de46be044e7b719dbe2529d57a92d1e72
|
data/README.md
CHANGED
@@ -68,29 +68,41 @@ integrated [example application](examples/rack/README.md).
|
|
68
68
|
The Ruby client can also be used to push its collected metrics to a
|
69
69
|
[Pushgateway][8]. This comes in handy with batch jobs or in other scenarios
|
70
70
|
where it's not possible or feasible to let a Prometheus server scrape a Ruby
|
71
|
-
process.
|
71
|
+
process. TLS and HTTP basic authentication are supported.
|
72
72
|
|
73
73
|
```ruby
|
74
74
|
require 'prometheus/client'
|
75
75
|
require 'prometheus/client/push'
|
76
76
|
|
77
|
-
|
77
|
+
registry = Prometheus::Client.registry
|
78
78
|
# ... register some metrics, set/increment/observe/etc. their values
|
79
79
|
|
80
80
|
# push the registry state to the default gateway
|
81
|
-
Prometheus::Client::Push.new('my-batch-job').add(
|
81
|
+
Prometheus::Client::Push.new(job: 'my-batch-job').add(registry)
|
82
82
|
|
83
|
-
# optional: specify
|
83
|
+
# optional: specify a grouping key that uniquely identifies a job instance, and gateway.
|
84
|
+
#
|
85
|
+
# Note: the labels you use in the grouping key must not conflict with labels set on the
|
86
|
+
# metrics being pushed. If they do, an error will be raised.
|
84
87
|
Prometheus::Client::Push.new(
|
85
|
-
'my-job',
|
88
|
+
job: 'my-batch-job',
|
89
|
+
gateway: 'https://example.domain:1234',
|
90
|
+
grouping_key: { instance: 'some-instance', extra_key: 'foobar' }
|
91
|
+
).add(registry)
|
86
92
|
|
87
|
-
# If you want to replace any previously pushed metrics for a given
|
93
|
+
# If you want to replace any previously pushed metrics for a given grouping key,
|
88
94
|
# use the #replace method.
|
89
|
-
|
90
|
-
|
91
|
-
#
|
95
|
+
#
|
96
|
+
# Unlike #add, this will completely replace the metrics under the specified grouping key
|
97
|
+
# (i.e. anything currently present in the pushgateway for the specified grouping key, but
|
98
|
+
# not present in the registry for that grouping key will be removed).
|
99
|
+
#
|
100
|
+
# See https://github.com/prometheus/pushgateway#put-method for a full explanation.
|
101
|
+
Prometheus::Client::Push.new(job: 'my-batch-job').replace(registry)
|
102
|
+
|
103
|
+
# If you want to delete all previously pushed metrics for a given grouping key,
|
92
104
|
# use the #delete method.
|
93
|
-
Prometheus::Client::Push.new('my-batch-job'
|
105
|
+
Prometheus::Client::Push.new(job: 'my-batch-job').delete
|
94
106
|
```
|
95
107
|
|
96
108
|
## Metrics
|