replayAnalyticsEvents.tsx 4.0 KB

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