Commit 7476bacb authored by Robert May's avatar Robert May

Update page limiter prometheus output

Now just stores a boolean of whether it was a bot or not.
parent 81786aa3
...@@ -91,10 +91,12 @@ module PageLimiter ...@@ -91,10 +91,12 @@ module PageLimiter
# Record the page limit being hit in Prometheus # Record the page limit being hit in Prometheus
def record_interception def record_interception
dd = DeviceDetector.new(request.user_agent)
Gitlab::Metrics.counter(:gitlab_page_out_of_bounds, Gitlab::Metrics.counter(:gitlab_page_out_of_bounds,
controller: params[:controller], controller: params[:controller],
action: params[:action], action: params[:action],
agent: request.user_agent bot: dd.bot?
) )
end end
end end
...@@ -170,7 +170,7 @@ describe PageLimiter do ...@@ -170,7 +170,7 @@ describe PageLimiter do
:gitlab_page_out_of_bounds, :gitlab_page_out_of_bounds,
controller: "explore/projects", controller: "explore/projects",
action: "index", action: "index",
agent: "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)" bot: true
) )
subject subject
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment