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 +4 -4
- data/lib/redis_prometheus/middleware.rb +19 -1
- data/lib/redis_prometheus/version.rb +1 -1
- data/lib/redis_prometheus.rb +1 -0
- data/redis_prometheus.gemspec +3 -3
- metadata +15 -15
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3f6991ef73de804ef14212c7f8a5bb9ecbd869f08382dc36fbdff7f404f6085d
|
4
|
+
data.tar.gz: 5dbc83c471022754bc6df21e4654c2d0dbec8b19b6b529073b354d530c8cc2dd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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"
|
data/lib/redis_prometheus.rb
CHANGED
data/redis_prometheus.gemspec
CHANGED
@@ -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"
|
25
|
-
spec.add_development_dependency "rake"
|
26
|
-
spec.add_development_dependency "rspec"
|
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.
|
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:
|
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: '
|
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: '
|
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: '
|
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: '
|
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: '
|
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: '
|
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.
|
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
|