Parse and log user agent type to NewRelic.
Parse the user agent and log whether it seems like a known bot or a human to NewRelic under the `user.bot` request attribute. This is so that known bots can be filtered out of search traffic analytics. Bots and search crawlers make up a significant portion of search traffic.
This commit is contained in:
@@ -74,7 +74,8 @@ class DanbooruLogger
|
||||
level: user&.level_string,
|
||||
ip: request.remote_ip,
|
||||
country: CurrentUser.country,
|
||||
safe_mode: CurrentUser.safe_mode?
|
||||
safe_mode: CurrentUser.safe_mode?,
|
||||
bot: UserAgent.new(request.headers["HTTP_USER_AGENT"]).is_bot?,
|
||||
}
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user