trackAdvancedAnalyticsEvent.tsx 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. import {coreUIEventMap, CoreUIEventParameters} from './coreuiAnalyticsEvents';
  2. import {dashboardsEventMap, DashboardsEventParameters} from './dashboardsAnalyticsEvents';
  3. import {discoverEventMap, DiscoverEventParameters} from './discoverAnalyticsEvents';
  4. import {
  5. dynamicSamplingEventMap,
  6. DynamicSamplingEventParameters,
  7. } from './dynamicSamplingAnalyticsEvents';
  8. import {growthEventMap, GrowthEventParameters} from './growthAnalyticsEvents';
  9. import {issueEventMap, IssueEventParameters} from './issueAnalyticsEvents';
  10. import makeAnalyticsFunction from './makeAnalyticsFunction';
  11. import {monitorsEventMap, MonitorsEventParameters} from './monitorsAnalyticsEvents';
  12. import {
  13. performanceEventMap,
  14. PerformanceEventParameters,
  15. } from './performanceAnalyticsEvents';
  16. import {profilingEventMap, ProfilingEventParameters} from './profilingAnalyticsEvents';
  17. import {releasesEventMap, ReleasesEventParameters} from './releasesAnalyticsEvents';
  18. import {replayEventMap, ReplayEventParameters} from './replayAnalyticsEvents';
  19. import {samplingEventMap, SamplingEventParameters} from './samplingAnalyticsEvents';
  20. import {searchEventMap, SearchEventParameters} from './searchAnalyticsEvents';
  21. import {settingsEventMap, SettingsEventParameters} from './settingsAnalyticsEvents';
  22. import {TeamInsightsEventParameters, workflowEventMap} from './workflowAnalyticsEvents';
  23. type EventParameters = GrowthEventParameters &
  24. CoreUIEventParameters &
  25. DashboardsEventParameters &
  26. DiscoverEventParameters &
  27. IssueEventParameters &
  28. MonitorsEventParameters &
  29. PerformanceEventParameters &
  30. ProfilingEventParameters &
  31. ReleasesEventParameters &
  32. ReplayEventParameters &
  33. SamplingEventParameters &
  34. SearchEventParameters &
  35. SettingsEventParameters &
  36. TeamInsightsEventParameters &
  37. DynamicSamplingEventParameters;
  38. const allEventMap: Record<string, string | null> = {
  39. ...coreUIEventMap,
  40. ...dashboardsEventMap,
  41. ...discoverEventMap,
  42. ...growthEventMap,
  43. ...issueEventMap,
  44. ...monitorsEventMap,
  45. ...performanceEventMap,
  46. ...profilingEventMap,
  47. ...releasesEventMap,
  48. ...replayEventMap,
  49. ...samplingEventMap,
  50. ...searchEventMap,
  51. ...settingsEventMap,
  52. ...workflowEventMap,
  53. ...dynamicSamplingEventMap,
  54. };
  55. /**
  56. * Generic typed analytics function for growth, issue, and performance events.
  57. * Can split up analytics functions to a smaller set of events like we do for trackIntegrationAnalytics
  58. */
  59. const trackAdvancedAnalyticsEvent = makeAnalyticsFunction<EventParameters>(allEventMap);
  60. export default trackAdvancedAnalyticsEvent;