stacktraceLinkAnalyticsEvents.ts 1.8 KB

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