search: log extra search metadata to NewRelic.

When a user does a tag search, log a few more things, including the normalized
search string, the number of tags in the search string, and the number of results.
This commit is contained in:
evazion
2021-01-11 21:59:00 -06:00
parent c05868e7f1
commit 81708d2ef8
2 changed files with 19 additions and 0 deletions

View File

@@ -12,6 +12,7 @@ class PostsController < ApplicationController
tag_query = params[:tags] || params.dig(:post, :tags)
@post_set = PostSets::Post.new(tag_query, params[:page], params[:limit], random: params[:random], format: params[:format])
@posts = authorize @post_set.posts, policy_class: PostPolicy
@post_set.log!
respond_with(@posts) do |format|
format.atom
end