stacktraceLinkAnalyticsEvents.ts 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. import {StacktraceErrorMessage} from 'sentry/components/events/interfaces/frame/stacktraceLink';
  2. import {PlatformType} from 'sentry/types';
  3. import {BaseEventAnalyticsParams} from 'sentry/utils/analytics/workflowAnalyticsEvents';
  4. import {IntegrationView} from './index';
  5. export enum StacktraceLinkEvents {
  6. RECONFIGURE_SETUP = 'integrations.reconfigure_stacktrace_setup',
  7. COMPLETE_SETUP = 'integrations.stacktrace_complete_setup',
  8. OPEN_DOCS = 'integrations.stacktrace_docs_clicked',
  9. OPEN_LINK = 'integrations.stacktrace_link_clicked',
  10. DISMISS_CTA = 'integrations.stacktrace_link_cta_dismissed',
  11. MANUAL_OPTION = 'integrations.stacktrace_manual_option_clicked',
  12. START_SETUP = 'integrations.stacktrace_start_setup',
  13. SUBMIT = 'integrations.stacktrace_submit_config',
  14. LINK_VIEWED = 'integrations.stacktrace_link_viewed',
  15. }
  16. // This type allows analytics functions to use the string literal or enum.KEY
  17. type StacktraceLinkEventsLiterals = `${StacktraceLinkEvents}`;
  18. export type StacktraceLinkEventParameters = {
  19. [key in StacktraceLinkEventsLiterals]: {
  20. error_reason?: StacktraceErrorMessage;
  21. platform?: PlatformType;
  22. project_id?: string;
  23. provider?: string;
  24. setup_type?: 'automatic' | 'manual';
  25. state?: 'match' | 'no_match' | 'prompt' | 'empty';
  26. } & IntegrationView &
  27. Partial<BaseEventAnalyticsParams>; // make optional
  28. };
  29. export const stacktraceLinkEventMap: Record<StacktraceLinkEventsLiterals, string> = {
  30. [StacktraceLinkEvents.RECONFIGURE_SETUP]: 'Integrations: Reconfigure Stacktrace Setup',
  31. [StacktraceLinkEvents.COMPLETE_SETUP]: 'Integrations: Stacktrace Complete Setup',
  32. [StacktraceLinkEvents.OPEN_DOCS]: 'Integrations: Stacktrace Docs Clicked',
  33. [StacktraceLinkEvents.OPEN_LINK]: 'Integrations: Stacktrace Link Clicked',
  34. [StacktraceLinkEvents.LINK_VIEWED]: 'Integrations: Stacktrace Link Viewed',
  35. [StacktraceLinkEvents.DISMISS_CTA]: 'Integrations: Stacktrace Link CTA Dismissed',
  36. [StacktraceLinkEvents.MANUAL_OPTION]: 'Integrations: Stacktrace Manual Option Clicked',
  37. [StacktraceLinkEvents.START_SETUP]: 'Integrations: Stacktrace Start Setup',
  38. [StacktraceLinkEvents.SUBMIT]: 'Integrations: Stacktrace Submit Config',
  39. };