redis_prometheus 0.5.2 → 0.6.0
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 +12 -0
- data/lib/redis_prometheus/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 057c01c6b5674330724729626b61ea92d4dbed94
|
4
|
+
data.tar.gz: c593b85ae67eb4110232daca8d3bf18684afdad9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f17669ba7f08c7e57cef7e25c80a4ab512c0ee7308bd72196599ccfe2822282fc2982ef404135d6a1980fbd36aa1b29f7baa738f7a99aa7dfc2d5b29455d5967
|
7
|
+
data.tar.gz: e99b4ce1fe12a2dd0a4a3702e9130ffc3c0aec8bde0dce9871e607173ba46a7bbd32bb245593e3671f4091a57e2253d2d28200bfe93bb661371c57dd62951241
|
@@ -74,6 +74,18 @@ module RedisPrometheus
|
|
74
74
|
requests = Redis.current.get("http_request_server_errors_counter/#{ENV["REDIS_PROMETHEUS_SERVICE"]}") || 0
|
75
75
|
response << "http_request_server_errors_counter{service=\"#{ENV["REDIS_PROMETHEUS_SERVICE"]}\"} #{requests.to_f}\n"
|
76
76
|
|
77
|
+
if defined?(Resque)
|
78
|
+
stats = Resque.info
|
79
|
+
|
80
|
+
response << "# TYPE http_request_queue_length gauge\n"
|
81
|
+
response << "# HELP http_request_queue_length The length of Resque's pending queues.\n"
|
82
|
+
response << "http_request_queue_length{service=\"#{ENV["REDIS_PROMETHEUS_SERVICE"]}\"} #{stats[:pending]}\n"
|
83
|
+
|
84
|
+
response << "# TYPE http_request_queue_failed gauge\n"
|
85
|
+
response << "# HELP http_request_queue_failed The length of Resque's failed queue.\n"
|
86
|
+
response << "http_request_queue_failed{service=\"#{ENV["REDIS_PROMETHEUS_SERVICE"]}\"} #{stats[:failed]}\n"
|
87
|
+
end
|
88
|
+
|
77
89
|
headers['Content-Encoding'] = "gzip"
|
78
90
|
headers['Content-Type'] = "text/plain"
|
79
91
|
gzip = Zlib::GzipWriter.new(StringIO.new)
|
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.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andy Jeffries
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-10-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|