redis_prometheus 0.3.0 → 0.4.0

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
  SHA1:
3
- metadata.gz: cebb34af64fb8bcc7f830ad839e473ea3571ce63
4
- data.tar.gz: e29c4c87aa940afe57a1531b2e86359bc1fd2a29
3
+ metadata.gz: 9d15bbf875ba90d1b3ae7cf5ce8c72e63846c3d4
4
+ data.tar.gz: 6524739795f794f0e9526cfffdcd8f9f6ae58254
5
5
  SHA512:
6
- metadata.gz: 725257ca85d443e29f17b71a824efa1f6b1b5a72aa301defd9ab89740907469dfc86911d8c8222bf16af60a48a54f17005b031f87391b16026c76583a66b0aa9
7
- data.tar.gz: 203942230f4dae2730656664ba5dec04ac36effc494afbc3173f81c254a2ad92844f34e290828521e0e3410a5be67056efd1398b11fba61d0de451851f324a97
6
+ metadata.gz: b8c479113ccee0b721b5ec4db66d1c7e272591cda666b5fd6dbef366abd021ca8a247b205446ecc8feb47af9fae7f95fa5d124526c6791878b8345405efeae06
7
+ data.tar.gz: 86ef33622f0083a7ef8e9b81b0b3d4027b0d6c30c537a94ed9127a01b3c794dabfc3b73a558b7d478e2e22f081f8b6b4e9906c68dda89aa79e2bd91aeca9fddf
@@ -51,10 +51,15 @@ module RedisPrometheus
51
51
  response << "} #{values[i].to_f}\n"
52
52
  end
53
53
 
54
- response << "# TYPE http_request_requests_counter counter\n"
55
- response << "# HELP http_request_requests_counter The total number of HTTP requests handled by the Rack application.\n"
56
- requests = Redis.current.get("http_request_requests_counter/#{ENV["REDIS_PROMETHEUS_SERVICE"]}") || 0
57
- response << "http_request_requests_counter{service=\"#{ENV["REDIS_PROMETHEUS_SERVICE"]}\"} #{requests.to_f}\n"
54
+ response << "# TYPE http_request_duration_seconds_count counter\n"
55
+ response << "# HELP http_request_duration_seconds_count The total number of HTTP requests handled by the Rack application.\n"
56
+ requests = Redis.current.get("http_request_duration_seconds_count/#{ENV["REDIS_PROMETHEUS_SERVICE"]}") || 0
57
+ response << "http_request_duration_seconds_count{service=\"#{ENV["REDIS_PROMETHEUS_SERVICE"]}\"} #{requests.to_f}\n"
58
+
59
+ response << "# TYPE http_request_duration_seconds_sum counter\n"
60
+ response << "# HELP http_request_duration_seconds_sum The total number of seconds spent processing HTTP requests by the Rack application.\n"
61
+ requests = Redis.current.get("http_request_duration_seconds_sum/#{ENV["REDIS_PROMETHEUS_SERVICE"]}") || 0
62
+ response << "http_request_duration_seconds_sum{service=\"#{ENV["REDIS_PROMETHEUS_SERVICE"]}\"} #{requests.to_f}\n"
58
63
 
59
64
  response << "# TYPE http_request_client_errors_counter counter\n"
60
65
  response << "# HELP http_request_client_errors_counter The total number of HTTP errors return by the Rack application.\n"
@@ -83,8 +88,8 @@ module RedisPrometheus
83
88
 
84
89
  bucket = duration_to_bucket(duration)
85
90
  Redis.current.incr("http_request_duration_seconds_bucket/#{ENV["REDIS_PROMETHEUS_SERVICE"]}:url=#{url}:le=#{bucket}")
86
- Redis.current.incr("http_request_requests_counter/#{ENV["REDIS_PROMETHEUS_SERVICE"]}")
87
- Redis.current.incrbyfloat("http_request_requests_seconds_sum/#{ENV["REDIS_PROMETHEUS_SERVICE"]}", duration)
91
+ Redis.current.incr("http_request_duration_seconds_count/#{ENV["REDIS_PROMETHEUS_SERVICE"]}")
92
+ Redis.current.incrbyfloat("http_request_duration_seconds_sum/#{ENV["REDIS_PROMETHEUS_SERVICE"]}", duration)
88
93
  if code.to_i >= 400 && code.to_i <= 499
89
94
  Redis.current.incr("http_request_client_errors_counter/#{ENV["REDIS_PROMETHEUS_SERVICE"]}")
90
95
  end
@@ -1,3 +1,3 @@
1
1
  module RedisPrometheus
2
- VERSION = "0.3.0"
2
+ VERSION = "0.4.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: redis_prometheus
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andy Jeffries