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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 35a2193b5080273f3311b1a3dbaf2fcd854af38f4cc30017da7b91c0879dbaa0
4
- data.tar.gz: 503c7bcfbc1acf0ff4a1dfb88e151bd71720c03569f91e4b9b61e16591ad063f
3
+ metadata.gz: 28745ccfcec4f7f79be0f0d64258aecf66e19e35aaf28681bf7284833fe7adfc
4
+ data.tar.gz: 04dd8b1fa4c8f769daff34345dbd039940af4fdf3a72d9c948893ea5e1b56835
5
5
  SHA512:
6
- metadata.gz: a774996689975c51d3d763a6e7d9187ccba7238212db72762df8981b1476559cd6c92b24d20b869f7402fdcf4ee4b9256efdc46f46dc7280d80a4024baf508f5
7
- data.tar.gz: a190ed7b811320c9c3f48cf084330e7347cfe173fd09deae795d991c6b3d0a7d8737940de0b50970eb34fcda61092864b4266d74d6220dad90d9c097071459f0
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
- prometheus = Prometheus::Client.registry
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(prometheus)
81
+ Prometheus::Client::Push.new(job: 'my-batch-job').add(registry)
82
82
 
83
- # optional: specify the instance name (instead of IP) and gateway
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', 'instance-name', 'http://example.domain:1234').add(prometheus)
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 instance,
93
+ # If you want to replace any previously pushed metrics for a given grouping key,
88
94
  # use the #replace method.
89
- Prometheus::Client::Push.new('my-batch-job', 'instance').replace(prometheus)
90
-
91
- # If you want to delete all previously pushed metrics for a given instance,
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', 'instance').delete
105
+ Prometheus::Client::Push.new(job: 'my-batch-job').delete
94
106
  ```
95
107
 
96
108
  ## Metrics