redis_prometheus 0.6.2 → 0.6.5

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: b955bca240b5b8fc04ae64e80a314af9696f05d7da5e1916b8a624807fd3f23f
4
- data.tar.gz: deab93a754ac345c87ee6835aac8c2743152482839b7ae90cc0af2b79fe29c44
3
+ metadata.gz: 3f6991ef73de804ef14212c7f8a5bb9ecbd869f08382dc36fbdff7f404f6085d
4
+ data.tar.gz: 5dbc83c471022754bc6df21e4654c2d0dbec8b19b6b529073b354d530c8cc2dd
5
5
  SHA512:
6
- metadata.gz: 199ce6f96de739d8bf5feacf1f7f15afff8ddd566dba24a26b04c7df9abf53f83e117b191f675790be29c90ef517da78b33026a33b1690b6b6d695baaed957ef
7
- data.tar.gz: 665f4d7600079601cb18a19005f356a13fdd17cc7c090a41d42970327efcc8fe02e50ce2e8b14349b5e0596e22704b1de29a3d364711c9403d514c82a30305d5
6
+ metadata.gz: f0720d28de5e515296e2cf8efc30f98082ff78404b1dcaa8d535de089be98e2e26fb2cb79fc2c047cd76d84dacd5f90fbb2254169a647fde5b32e77e04c90979
7
+ data.tar.gz: f3ca8b65a9f9d318ee8c51ee7beb2f40a7083aeb971a73d094b5995e98b6684b80e1ee876bce919b1f9a836143ca7e47382e2f027fafc3f3562e2c64c5102527
@@ -54,6 +54,8 @@ module RedisPrometheus
54
54
  response << "} #{values[i].to_f}\n"
55
55
  end
56
56
 
57
+ response << RedisPrometheus::Collector.current.stats
58
+
57
59
  response << "# TYPE http_request_duration_seconds_count counter\n"
58
60
  response << "# HELP http_request_duration_seconds_count The total number of HTTP requests handled by the Rack application.\n"
59
61
  requests = Redis.current.get("http_request_duration_seconds_count/#{ENV["REDIS_PROMETHEUS_SERVICE"]}") || 0
@@ -86,7 +88,23 @@ module RedisPrometheus
86
88
  response << "http_request_queue_failed{service=\"#{ENV["REDIS_PROMETHEUS_SERVICE"]}\"} #{stats[:failed]}\n"
87
89
  end
88
90
 
89
-
91
+ if defined?(Sidekiq)
92
+ queue_length = 0
93
+ Sidekiq::Queue.all.each do |q|
94
+ queue_length += q.size
95
+ end
96
+
97
+ ds = Sidekiq::DeadSet.new
98
+ failed = ds.size
99
+
100
+ response << "# TYPE http_request_queue_length gauge\n"
101
+ response << "# HELP http_request_queue_length The length of Resque's pending queues.\n"
102
+ response << "http_request_queue_length{service=\"#{ENV["REDIS_PROMETHEUS_SERVICE"]}\"} #{queue_length}\n"
103
+
104
+ response << "# TYPE http_request_queue_failed gauge\n"
105
+ response << "# HELP http_request_queue_failed The length of Resque's failed queue.\n"
106
+ response << "http_request_queue_failed{service=\"#{ENV["REDIS_PROMETHEUS_SERVICE"]}\"} #{failed}\n"
107
+ end
90
108
 
91
109
  headers['Content-Encoding'] = "gzip"
92
110
  headers['Content-Type'] = "text/plain"
@@ -1,3 +1,3 @@
1
1
  module RedisPrometheus
2
- VERSION = "0.6.2"
2
+ VERSION = "0.6.5"
3
3
  end
@@ -1,6 +1,7 @@
1
1
  require "redis_prometheus/middleware"
2
2
  require "redis_prometheus/railtie" if defined?(Rails)
3
3
  require "redis_prometheus/version"
4
+ require "redis_prometheus/collector"
4
5
 
5
6
  module RedisPrometheus
6
7
  # Your code goes here...
@@ -21,7 +21,7 @@ Gem::Specification.new do |spec|
21
21
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
22
22
  spec.require_paths = ["lib"]
23
23
 
24
- spec.add_development_dependency "bundler", "~> 1.14"
25
- spec.add_development_dependency "rake", "> 10.0"
26
- spec.add_development_dependency "rspec", "~> 3.0"
24
+ spec.add_development_dependency "bundler"
25
+ spec.add_development_dependency "rake"
26
+ spec.add_development_dependency "rspec"
27
27
  end
metadata CHANGED
@@ -1,57 +1,57 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: redis_prometheus
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.2
4
+ version: 0.6.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andy Jeffries
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-03-20 00:00:00.000000000 Z
11
+ date: 2022-04-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '1.14'
19
+ version: '0'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: '1.14'
26
+ version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ">"
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: '10.0'
33
+ version: '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
- version: '10.0'
40
+ version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rspec
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - "~>"
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
- version: '3.0'
47
+ version: '0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - "~>"
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
- version: '3.0'
54
+ version: '0'
55
55
  description: In order to ensure all your statistics are served to Prometheus across
56
56
  multiple machines/pods/instances/containers, store the details in Redis
57
57
  email:
@@ -94,7 +94,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
94
94
  - !ruby/object:Gem::Version
95
95
  version: '0'
96
96
  requirements: []
97
- rubygems_version: 3.0.6
97
+ rubygems_version: 3.1.2
98
98
  signing_key:
99
99
  specification_version: 4
100
100
  summary: Capture and serve rack statistics for Prometheus in Redis