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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9d15bbf875ba90d1b3ae7cf5ce8c72e63846c3d4
4
- data.tar.gz: 6524739795f794f0e9526cfffdcd8f9f6ae58254
3
+ metadata.gz: ea247931a4430c99043f59747f2d433e4c3d7b30
4
+ data.tar.gz: 873124745c75f873387af9d94aab0dd3661285bf
5
5
  SHA512:
6
- metadata.gz: b8c479113ccee0b721b5ec4db66d1c7e272591cda666b5fd6dbef366abd021ca8a247b205446ecc8feb47af9fae7f95fa5d124526c6791878b8345405efeae06
7
- data.tar.gz: 86ef33622f0083a7ef8e9b81b0b3d4027b0d6c30c537a94ed9127a01b3c794dabfc3b73a558b7d478e2e22f081f8b6b4e9906c68dda89aa79e2bd91aeca9fddf
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"]}:url=#{url}:le=#{bucket}")
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
@@ -1,3 +1,3 @@
1
1
  module RedisPrometheus
2
- VERSION = "0.4.0"
2
+ VERSION = "0.5.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.4.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andy Jeffries