Sessions-per-User Inflated After a Tracking Change

PySpark · observability · Advanced · about 20 minutes

Impact

After a tracking update started logging every click and scroll as its own row, the engagement dashboard's sessions-per-user figure jumped.

Symptoms

Evidence

user_actions profile

measurevalue
rows8
distinct session_id5
distinct user_id3

Sessions per user

sourcevalue
dashboard2.67
distinct sessions / users1.67

user_actions for user 102

user_idsession_idaction_timeaction_type
102S32024-01-02 09:00:00click
102S32024-01-02 09:30:00scroll

Investigation task

For each user, report the time of their most recent action as latest_session_time and their number of distinct sessions as unique_session_count. Build df_result with user_id, latest_session_time and unique_session_count, and finish with df_result.show().

The fix is written and graded in the regular challenge editor. The postmortem unlocks once the incident is resolved.

All production incidents