redis_prometheus 0.6.1 → 0.6.2

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: 75e9c46488f952d2c812d23091b0404dbb42b8da00fea580a6bd89729ecc66b4
4
- data.tar.gz: 961d40f0a53973bbcbbb5c4a00b8ea5ff74d3327ee4f9fba870353ff9ab7a4a8
3
+ metadata.gz: b955bca240b5b8fc04ae64e80a314af9696f05d7da5e1916b8a624807fd3f23f
4
+ data.tar.gz: deab93a754ac345c87ee6835aac8c2743152482839b7ae90cc0af2b79fe29c44
5
5
  SHA512:
6
- metadata.gz: be7b4f411e263adae747c2f31febec8f5ce780c2047906da68d440be85261f1d534873b26c5791027e0962df6ec3d164c7ab5745526ff4f1f15262b792d9643f
7
- data.tar.gz: f98882fa04252ec55f27ae3f5f5950d5695c0da15adf5034db029277d4f20d55c44f6596b37832279ecac5c9c2fea8fd26b143a52b6350409ec682a25434cb07
6
+ metadata.gz: 199ce6f96de739d8bf5feacf1f7f15afff8ddd566dba24a26b04c7df9abf53f83e117b191f675790be29c90ef517da78b33026a33b1690b6b6d695baaed957ef
7
+ data.tar.gz: 665f4d7600079601cb18a19005f356a13fdd17cc7c090a41d42970327efcc8fe02e50ce2e8b14349b5e0596e22704b1de29a3d364711c9403d514c82a30305d5
data/README.md CHANGED
@@ -4,6 +4,8 @@ After realising all the current gem solutions for Rails + Prometheus only report
4
4
 
5
5
  **IMPORTANT:** This gem has no tests yet and is brand new, it was written for our internal needs and has been open-sourced under the MIT licence, but it DEFINITELY comes with zero warranty at all, including that it will either work and won't open your site up to hackers!
6
6
 
7
+ **STATUS:** This project is currently under active development and maintainance.
8
+
7
9
  ## Installation
8
10
 
9
11
  Add this line to your application's Gemfile:
@@ -0,0 +1,28 @@
1
+ module RedisPrometheus
2
+ class Collector
3
+ def self.current
4
+ @current ||= self.new
5
+ @current
6
+ end
7
+
8
+ def initialize
9
+ @collectors = []
10
+ end
11
+
12
+ def stats
13
+ out = ""
14
+ @collectors.each do |collector|
15
+ ret = collector.call
16
+ out << "# TYPE #{ret[:label]} #{ret[:type]}\n"
17
+ out << "# HELP #{ret[:label]} #{ret[:description]}.\n"
18
+
19
+ out << "#{ret[:label]}{service=\"#{ENV["REDIS_PROMETHEUS_SERVICE"]}\"} #{ret[:data]}\n"
20
+ end
21
+ out
22
+ end
23
+
24
+ def register(&block)
25
+ @collectors << block
26
+ end
27
+ end
28
+ end
@@ -86,6 +86,8 @@ module RedisPrometheus
86
86
  response << "http_request_queue_failed{service=\"#{ENV["REDIS_PROMETHEUS_SERVICE"]}\"} #{stats[:failed]}\n"
87
87
  end
88
88
 
89
+
90
+
89
91
  headers['Content-Encoding'] = "gzip"
90
92
  headers['Content-Type'] = "text/plain"
91
93
  gzip = Zlib::GzipWriter.new(StringIO.new)
@@ -1,3 +1,3 @@
1
1
  module RedisPrometheus
2
- VERSION = "0.6.1"
2
+ VERSION = "0.6.2"
3
3
  end
@@ -22,6 +22,6 @@ Gem::Specification.new do |spec|
22
22
  spec.require_paths = ["lib"]
23
23
 
24
24
  spec.add_development_dependency "bundler", "~> 1.14"
25
- spec.add_development_dependency "rake", "~> 10.0"
25
+ spec.add_development_dependency "rake", "> 10.0"
26
26
  spec.add_development_dependency "rspec", "~> 3.0"
27
27
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: redis_prometheus
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.1
4
+ version: 0.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andy Jeffries
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-04-01 00:00:00.000000000 Z
11
+ date: 2020-03-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -28,14 +28,14 @@ dependencies:
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ">"
32
32
  - !ruby/object:Gem::Version
33
33
  version: '10.0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - "~>"
38
+ - - ">"
39
39
  - !ruby/object:Gem::Version
40
40
  version: '10.0'
41
41
  - !ruby/object:Gem::Dependency
@@ -70,6 +70,7 @@ files:
70
70
  - bin/console
71
71
  - bin/setup
72
72
  - lib/redis_prometheus.rb
73
+ - lib/redis_prometheus/collector.rb
73
74
  - lib/redis_prometheus/middleware.rb
74
75
  - lib/redis_prometheus/railtie.rb
75
76
  - lib/redis_prometheus/version.rb
@@ -93,7 +94,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
93
94
  - !ruby/object:Gem::Version
94
95
  version: '0'
95
96
  requirements: []
96
- rubygems_version: 3.0.1
97
+ rubygems_version: 3.0.6
97
98
  signing_key:
98
99
  specification_version: 4
99
100
  summary: Capture and serve rack statistics for Prometheus in Redis