Skip to content

Commit

Permalink
Appsignal, switch to session data
Browse files Browse the repository at this point in the history
The tags doesn't seem to get set on new issue.
  • Loading branch information
thibaudgg committed Nov 9, 2024
1 parent 551ef35 commit 3128820
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def authenticate_admin!
cookies.delete(:session_id)
redirect_to login_path, alert: t("sessions.flash.expired")
else
set_appsignal_tags
add_appsignal_session_data
update_last_usage(current_session)
end
end
Expand Down Expand Up @@ -78,9 +78,9 @@ def update_last_usage(session)
last_user_agent: request.env.fetch("HTTP_USER_AGENT", "-"))
end

def set_appsignal_tags
Appsignal.add_tags(
id: "admin_#{current_admin.id}",
def add_appsignal_session_data
Appsignal.add_session_data(
admin_id: current_admin.id,
session_id: current_session.id)
end

Expand Down
8 changes: 4 additions & 4 deletions app/controllers/members/base_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def authenticate_member!
cookies.delete(:session_id)
redirect_to members_login_path, alert: t("sessions.flash.expired")
else
set_appsignal_tags
add_appsignal_session_data
update_last_usage(current_session)
end
end
Expand All @@ -39,9 +39,9 @@ def set_locale
Current.org.languages.first
end

def set_appsignal_tags
Appsignal.add_tags(
id: "member_#{current_member.id}",
def add_appsignal_session_data
Appsignal.add_session_data(
member_id: current_member.id,
session_id: current_session.id)
end

Expand Down
2 changes: 1 addition & 1 deletion lib/tenant.rb
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def leave
def current=(tenant)
Thread.current[:current_tenant] = tenant
Current.reset
Appsignal.add_tags(tenant: tenant)
Appsignal.add_session_data(tenant: tenant)
end

def config
Expand Down

0 comments on commit 3128820

Please sign in to comment.