redis_prometheus 0.4.0 → 0.5.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 +4 -2
- data/lib/redis_prometheus/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ea247931a4430c99043f59747f2d433e4c3d7b30
|
4
|
+
data.tar.gz: 873124745c75f873387af9d94aab0dd3661285bf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 435a8d12651ab21583e441ff543a889216c238b65d93ac2389a759b5793a8d02de22c93783c57db4e25d03205baa47934e5734180da522da57232afe2cfed3e1
|
7
|
+
data.tar.gz: 706332e8925a96cc1f26c05c217f3c0048e813dd4e6e33db270052095f10ef345399cc2dfef5239c2456b480ce291981eae68fcd3174547e18767216f1614e15
|
@@ -34,7 +34,7 @@ module RedisPrometheus
|
|
34
34
|
response << "# TYPE http_request_duration_seconds_bucket histogram\n"
|
35
35
|
response << "# HELP http_request_duration_seconds_bucket The HTTP response duration of the Rack application.\n"
|
36
36
|
keys.each_with_index do |key, i|
|
37
|
-
key_parts = key.split("
|
37
|
+
key_parts = key.split("|")
|
38
38
|
key_parts.shift
|
39
39
|
|
40
40
|
data = {}
|
@@ -85,9 +85,11 @@ module RedisPrometheus
|
|
85
85
|
return if Rails.application.config.redis_prometheus.ignored_urls.include?(url)
|
86
86
|
|
87
87
|
url.gsub!(%r{[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}}i, "{uuid}")
|
88
|
+
url.gsub!(%r{/\b\d+\b}i, "{id}")
|
89
|
+
url.gsub!(":id", "{id}")
|
88
90
|
|
89
91
|
bucket = duration_to_bucket(duration)
|
90
|
-
Redis.current.incr("http_request_duration_seconds_bucket/#{ENV["REDIS_PROMETHEUS_SERVICE"]}
|
92
|
+
Redis.current.incr("http_request_duration_seconds_bucket/#{ENV["REDIS_PROMETHEUS_SERVICE"]}|url=#{url}|le=#{bucket}")
|
91
93
|
Redis.current.incr("http_request_duration_seconds_count/#{ENV["REDIS_PROMETHEUS_SERVICE"]}")
|
92
94
|
Redis.current.incrbyfloat("http_request_duration_seconds_sum/#{ENV["REDIS_PROMETHEUS_SERVICE"]}", duration)
|
93
95
|
if code.to_i >= 400 && code.to_i <= 499
|