replayAnalyticsEvents.tsx 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. import type {LayoutKey} from 'sentry/utils/replays/hooks/useReplayLayout';
  2. import {Output} from 'sentry/views/replays/detail/network/details/getOutputType';
  3. export type ReplayEventParameters = {
  4. 'replay.details-layout-changed': {
  5. chosen_layout: LayoutKey;
  6. default_layout: LayoutKey;
  7. };
  8. 'replay.details-network-panel-closed': {
  9. is_sdk_setup: boolean;
  10. };
  11. 'replay.details-network-panel-opened': {
  12. is_sdk_setup: boolean;
  13. resource_method: string;
  14. resource_status: string;
  15. resource_type: string;
  16. };
  17. 'replay.details-network-tab-changed': {
  18. is_sdk_setup: boolean;
  19. output: Output;
  20. resource_method: string;
  21. resource_status: string;
  22. resource_type: string;
  23. tab: string;
  24. };
  25. 'replay.details-resized-panel': {
  26. layout: LayoutKey;
  27. slide_motion: 'toTop' | 'toBottom' | 'toLeft' | 'toRight';
  28. };
  29. 'replay.details-tab-changed': {
  30. tab: string;
  31. };
  32. 'replay.details-time-spent': {
  33. seconds: number;
  34. user_email: string;
  35. };
  36. 'replay.details-viewed': {
  37. referrer: undefined | string;
  38. user_email: string;
  39. };
  40. // similar purpose as "replay.details-viewed", however we're capturing the navigation action
  41. // in order to also include a project platform
  42. 'replay.list-navigate-to-details': {
  43. platform: string | undefined;
  44. project_id: string | undefined;
  45. referrer: string;
  46. };
  47. 'replay.list-paginated': {
  48. direction: 'next' | 'prev';
  49. };
  50. 'replay.list-sorted': {
  51. column: string;
  52. };
  53. 'replay.list-time-spent': {
  54. seconds: number;
  55. user_email: string;
  56. };
  57. 'replay.list-view-setup-sidebar': {};
  58. 'replay.play-pause': {
  59. play: boolean;
  60. user_email: string;
  61. };
  62. 'replay.render-issues-group-list': {
  63. platform: string | undefined;
  64. project_id: string | undefined;
  65. };
  66. 'replay.render-player': {
  67. aspect_ratio: 'portrait' | 'landscape';
  68. /*
  69. * What scale is the video as a percent, bucketed into ranges of 10% increments
  70. * example:
  71. * - The video is shown at 25% the normal size
  72. * - in CSS we use the statement `transform: scale(0.25);`
  73. * - The logged value is `20`, because the scale is in the range of 20% to 30%.
  74. */
  75. scale_bucket: 0 | 10 | 20 | 30 | 40 | 50 | 60 | 70 | 80 | 90 | 100;
  76. };
  77. 'replay.search': {
  78. search_keys: string;
  79. };
  80. 'replay.toggle-fullscreen': {
  81. fullscreen: boolean;
  82. user_email: string;
  83. };
  84. };
  85. export type ReplayEventKey = keyof ReplayEventParameters;
  86. export const replayEventMap: Record<ReplayEventKey, string | null> = {
  87. 'replay.details-layout-changed': 'Changed Replay Details Layout',
  88. 'replay.details-network-panel-closed': 'Closed Replay Network Details Panel',
  89. 'replay.details-network-panel-opened': 'Opened Replay Network Details Panel',
  90. 'replay.details-network-tab-changed': 'Changed Replay Network Details Tab',
  91. 'replay.details-resized-panel': 'Resized Replay Details Panel',
  92. 'replay.details-tab-changed': 'Changed Replay Details Tab',
  93. 'replay.details-time-spent': 'Time Spent Viewing Replay Details',
  94. 'replay.details-viewed': 'Viewed Replay Details',
  95. 'replay.list-navigate-to-details': 'Replays List Navigate to Replay Details',
  96. 'replay.list-paginated': 'Paginated Replay List',
  97. 'replay.list-sorted': 'Sorted Replay List',
  98. 'replay.list-time-spent': 'Time Spent Viewing Replay List',
  99. 'replay.list-view-setup-sidebar': 'Views Set Up Replays Sidebar',
  100. 'replay.play-pause': 'Played/Paused Replay',
  101. 'replay.render-issues-group-list': 'Render Issues Detail Replay List',
  102. 'replay.render-player': 'Rendered ReplayPlayer',
  103. 'replay.search': 'Searched Replay',
  104. 'replay.toggle-fullscreen': 'Toggled Replay Fullscreen',
  105. };