[deploy] Track How Often We Hit Ambiguous Routes (#8098)

This commit is contained in:
Molly Struve 2020-05-28 07:56:00 -05:00 committed by GitHub
parent 4e97623823
commit 0edca1fe2c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 0 deletions

View file

@ -197,8 +197,10 @@ class ArticlesController < ApplicationController
def handle_user_or_organization_feed
if (@user = User.find_by(username: params[:username]))
Honeycomb.add_field("articles_route.user", true)
@articles = @articles.where(user_id: @user.id)
elsif (@user = Organization.find_by(slug: params[:username]))
Honeycomb.add_field("articles_route.org", true)
@articles = @articles.where(organization_id: @user.id).includes(:user)
end
end

View file

@ -105,12 +105,16 @@ class StoriesController < ApplicationController
@organization = Organization.find_by(slug: params[:username])
@page = Page.find_by(slug: params[:username], is_top_level_path: true)
if @podcast
Honeycomb.add_field("stories_route.podcast", true)
handle_podcast_index
elsif @organization
Honeycomb.add_field("stories_route.org", true)
handle_organization_index
elsif @page
Honeycomb.add_field("stories_route.page", true)
handle_page_display
else
Honeycomb.add_field("stories_route.user", true)
handle_user_index
end
end