workflowAnalyticsEvents.tsx 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. import type {ResolutionStatus} from 'sentry/types';
  2. type RuleViewed = {
  3. alert_type: 'issue' | 'metric';
  4. project_id: string;
  5. };
  6. type IssueDetailsWithAlert = {
  7. group_id: number;
  8. project_id: number;
  9. /** The time that the alert was initially fired. */
  10. alert_date?: string;
  11. /** Id of the rule that triggered the alert */
  12. alert_rule_id?: string;
  13. /** The type of alert notification - email/slack */
  14. alert_type?: string;
  15. };
  16. export type TeamInsightsEventParameters = {
  17. 'alert_builder.filter': {query: string; session_id?: string};
  18. 'alert_details.viewed': {alert_id: number};
  19. 'alert_rule_details.viewed': {alert: string; has_chartcuterie: string; rule_id: number};
  20. 'alert_rules.viewed': {sort: string};
  21. 'alert_stream.viewed': {};
  22. 'alert_wizard.option_selected': {alert_type: string};
  23. 'alert_wizard.option_viewed': {alert_type: string};
  24. 'edit_alert_rule.add_row': {
  25. name: string;
  26. project_id: string;
  27. type: string;
  28. };
  29. 'edit_alert_rule.viewed': RuleViewed;
  30. 'issue_alert_rule_details.edit_clicked': {rule_id: number};
  31. 'issue_alert_rule_details.viewed': {rule_id: number};
  32. 'issue_details.action_clicked': IssueDetailsWithAlert & {
  33. action_type:
  34. | 'deleted'
  35. | 'mark_reviewed'
  36. | 'bookmarked'
  37. | 'subscribed'
  38. | 'shared'
  39. | 'discarded'
  40. | 'open_in_discover'
  41. | 'assign'
  42. | ResolutionStatus;
  43. };
  44. 'issue_details.event_json_clicked': {group_id: number};
  45. 'issue_details.event_navigation_clicked': {button: string; project_id: number};
  46. 'issue_details.viewed': IssueDetailsWithAlert;
  47. 'new_alert_rule.viewed': RuleViewed & {
  48. duplicate_rule: string;
  49. session_id: string;
  50. wizard_v3: string;
  51. };
  52. 'project_creation_page.created': {
  53. issue_alert: 'Default' | 'Custom' | 'No Rule';
  54. metric_alerts: string;
  55. project_id: string;
  56. rule_id: string;
  57. };
  58. 'project_creation_page.viewed': {};
  59. 'team_insights.viewed': {};
  60. };
  61. export type TeamInsightsEventKey = keyof TeamInsightsEventParameters;
  62. export const workflowEventMap: Record<TeamInsightsEventKey, string | null> = {
  63. 'alert_builder.filter': 'Alert Builder: Filter',
  64. 'alert_details.viewed': 'Alert Details: Viewed',
  65. 'alert_rule_details.viewed': 'Alert Rule Details: Viewed',
  66. 'alert_rules.viewed': 'Alert Rules: Viewed',
  67. 'alert_stream.viewed': 'Alert Stream: Viewed',
  68. 'alert_wizard.option_selected': 'Alert Wizard: Option Selected',
  69. 'alert_wizard.option_viewed': 'Alert Wizard: Option Viewed',
  70. 'edit_alert_rule.add_row': 'Edit Alert Rule: Add Row',
  71. 'edit_alert_rule.viewed': 'Edit Alert Rule: Viewed',
  72. 'issue_alert_rule_details.edit_clicked': 'Issue Alert Rule Details: Edit Clicked',
  73. 'issue_alert_rule_details.viewed': 'Issue Alert Rule Details: Viewed',
  74. 'issue_details.action_clicked': 'Issue Details: Action Clicked',
  75. 'issue_details.event_json_clicked': 'Issue Details: Event JSON Clicked',
  76. 'issue_details.event_navigation_clicked': 'Issue Details: Event Navigation Clicked',
  77. 'issue_details.viewed': 'Issue Details: Viewed',
  78. 'new_alert_rule.viewed': 'New Alert Rule: Viewed',
  79. 'team_insights.viewed': 'Team Insights: Viewed',
  80. 'project_creation_page.viewed': 'Project Create: Creation page viewed',
  81. 'project_creation_page.created': 'Project Create: Project Created',
  82. };