summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJan Provaznik <jprovaznik@gitlab.com>2019-06-12 12:33:34 +0200
committerJan Provaznik <jprovaznik@gitlab.com>2019-06-12 12:33:34 +0200
commit13364c00d57ce3150a50c23ea3eb0e6af4271d92 (patch)
tree7f31f9e3fb368f7f37c7fa205123c4d550e56df9 /lib
parentd3a7bdda986949ca76df3c4932ee8c973437a743 (diff)
downloadgitlab-ce-13364c00d57ce3150a50c23ea3eb0e6af4271d92.tar.gz
Monitor only final statesrack-timeout-rename
There is no reason to monitor transition states so we ignore ready and active states. We can get ratio of completed vs failed requests from final states.
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab/cluster/rack_timeout_observer.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/gitlab/cluster/rack_timeout_observer.rb b/lib/gitlab/cluster/rack_timeout_observer.rb
index 2bc006b8011..5182b2be148 100644
--- a/lib/gitlab/cluster/rack_timeout_observer.rb
+++ b/lib/gitlab/cluster/rack_timeout_observer.rb
@@ -3,8 +3,10 @@
module Gitlab
module Cluster
class RackTimeoutObserver
+ TRANSITION_STATES = %i(ready active).freeze
+
def initialize
- @counter = Gitlab::Metrics.counter(:rack_state_total, 'Number of requests in a given rack state')
+ @counter = Gitlab::Metrics.counter(:rack_requests_total, 'Number of requests in a given rack state')
end
# returns the Proc to be used as the observer callback block
@@ -17,6 +19,7 @@ module Gitlab
def log_timeout_exception(env)
info = env[::Rack::Timeout::ENV_INFO_KEY]
return unless info
+ return if TRANSITION_STATES.include?(info.state)
@counter.increment(labels(info, env))
end