data.tsx 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. import {t} from 'sentry/locale';
  2. import type {NewQuery} from 'sentry/types/organization';
  3. import {SavedQueryDatasets} from 'sentry/utils/discover/types';
  4. export const DEFAULT_EVENT_VIEW: Readonly<NewQuery> = {
  5. id: undefined,
  6. name: t('All Events'),
  7. query: '',
  8. projects: [],
  9. fields: ['title', 'event.type', 'project', 'user.display', 'timestamp'],
  10. orderby: '-timestamp',
  11. version: 2,
  12. range: '24h',
  13. };
  14. const DEFAULT_TRANSACTION_VIEW: Readonly<NewQuery> = {
  15. id: undefined,
  16. name: t('All Transactions'),
  17. query: 'event.type:transaction',
  18. projects: [],
  19. fields: ['title', 'project', 'user.display', 'timestamp'],
  20. orderby: '-timestamp',
  21. version: 2,
  22. range: '24h',
  23. };
  24. const DEFAULT_ERROR_VIEW: Readonly<NewQuery> = {
  25. id: undefined,
  26. name: t('All Errors'),
  27. query: 'event.type:error', // what about csp events etc
  28. projects: [],
  29. fields: ['title', 'project', 'user.display', 'timestamp'],
  30. orderby: '-timestamp',
  31. version: 2,
  32. range: '24h',
  33. };
  34. export const DEFAULT_EVENT_VIEW_MAP: Record<SavedQueryDatasets, Readonly<NewQuery>> = {
  35. [SavedQueryDatasets.DISCOVER]: DEFAULT_EVENT_VIEW,
  36. [SavedQueryDatasets.ERRORS]: DEFAULT_ERROR_VIEW,
  37. [SavedQueryDatasets.TRANSACTIONS]: DEFAULT_TRANSACTION_VIEW,
  38. };
  39. export const TRANSACTION_VIEWS: Readonly<Array<NewQuery>> = [
  40. {
  41. id: undefined,
  42. name: t('Transactions by Volume'),
  43. fields: [
  44. 'transaction',
  45. 'project',
  46. 'count()',
  47. 'avg(transaction.duration)',
  48. 'p75()',
  49. 'p95()',
  50. ],
  51. orderby: '-count',
  52. query: 'event.type:transaction',
  53. projects: [],
  54. version: 2,
  55. range: '24h',
  56. },
  57. ];
  58. export const WEB_VITALS_VIEWS: Readonly<Array<NewQuery>> = [
  59. {
  60. id: undefined,
  61. name: t('Web Vitals'),
  62. fields: [
  63. 'transaction',
  64. 'epm()',
  65. 'p75(measurements.fp)',
  66. 'p75(measurements.fcp)',
  67. 'p75(measurements.lcp)',
  68. 'p75(measurements.fid)',
  69. 'p75(measurements.cls)',
  70. ],
  71. orderby: '-epm',
  72. query: 'event.type:transaction transaction.op:pageload',
  73. projects: [],
  74. version: 2,
  75. range: '24h',
  76. yAxis: ['epm()'],
  77. },
  78. ];
  79. export const ALL_VIEWS: Readonly<Array<NewQuery>> = [
  80. DEFAULT_EVENT_VIEW,
  81. {
  82. id: undefined,
  83. name: t('Errors by Title'),
  84. fields: ['title', 'count()', 'count_unique(user)', 'project'],
  85. orderby: '-count',
  86. query: 'event.type:error',
  87. projects: [],
  88. version: 2,
  89. range: '24h',
  90. display: 'top5',
  91. },
  92. {
  93. id: undefined,
  94. name: t('Errors by URL'),
  95. fields: ['url', 'count()', 'count_unique(issue)'],
  96. orderby: '-count',
  97. query: 'event.type:error has:url',
  98. projects: [],
  99. version: 2,
  100. range: '24h',
  101. display: 'top5',
  102. },
  103. ];