data.tsx 37 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518
  1. import {t} from 'sentry/locale';
  2. import {uniqueId} from 'sentry/utils/guid';
  3. import type {DashboardDetails} from './types';
  4. import {DisplayType, WidgetType} from './types';
  5. type DashboardTemplate = DashboardDetails & {
  6. description: string;
  7. };
  8. export const EMPTY_DASHBOARD: DashboardDetails = {
  9. id: '',
  10. dateCreated: '',
  11. createdBy: undefined,
  12. title: t('Untitled dashboard'),
  13. widgets: [],
  14. projects: [],
  15. filters: {},
  16. };
  17. export const DASHBOARDS_TEMPLATES: DashboardTemplate[] = [
  18. {
  19. id: 'default-template',
  20. dateCreated: '',
  21. createdBy: undefined,
  22. title: t('General Template'),
  23. description: t('Various Frontend and Backend Widgets'),
  24. projects: [],
  25. filters: {},
  26. widgets: [
  27. {
  28. title: t('Number of Errors'),
  29. displayType: DisplayType.BIG_NUMBER,
  30. interval: '5m',
  31. widgetType: WidgetType.DISCOVER,
  32. tempId: uniqueId(),
  33. layout: {
  34. h: 1,
  35. minH: 1,
  36. w: 1,
  37. x: 0,
  38. y: 0,
  39. },
  40. queries: [
  41. {
  42. name: '',
  43. fields: ['count()'],
  44. aggregates: ['count()'],
  45. columns: [],
  46. conditions: '!event.type:transaction',
  47. orderby: 'count()',
  48. },
  49. ],
  50. },
  51. {
  52. title: t('Number of Issues'),
  53. displayType: DisplayType.BIG_NUMBER,
  54. interval: '5m',
  55. widgetType: WidgetType.DISCOVER,
  56. tempId: uniqueId(),
  57. layout: {
  58. h: 1,
  59. minH: 1,
  60. w: 1,
  61. x: 1,
  62. y: 0,
  63. },
  64. queries: [
  65. {
  66. name: '',
  67. fields: ['count_unique(issue)'],
  68. aggregates: ['count_unique(issue)'],
  69. columns: [],
  70. conditions: '!event.type:transaction',
  71. orderby: 'count_unique(issue)',
  72. },
  73. ],
  74. },
  75. {
  76. title: t('Events'),
  77. displayType: DisplayType.LINE,
  78. interval: '5m',
  79. widgetType: WidgetType.DISCOVER,
  80. tempId: uniqueId(),
  81. layout: {
  82. h: 2,
  83. minH: 2,
  84. w: 4,
  85. x: 2,
  86. y: 0,
  87. },
  88. queries: [
  89. {
  90. name: t('Events'),
  91. fields: ['count()'],
  92. aggregates: ['count()'],
  93. columns: [],
  94. conditions: '!event.type:transaction',
  95. orderby: 'count()',
  96. },
  97. ],
  98. },
  99. {
  100. title: t('Affected Users'),
  101. displayType: DisplayType.LINE,
  102. interval: '5m',
  103. widgetType: WidgetType.DISCOVER,
  104. tempId: uniqueId(),
  105. layout: {
  106. h: 2,
  107. minH: 2,
  108. w: 1,
  109. x: 1,
  110. y: 2,
  111. },
  112. queries: [
  113. {
  114. name: t('Known Users'),
  115. fields: ['count_unique(user)'],
  116. aggregates: ['count_unique(user)'],
  117. columns: [],
  118. conditions: 'has:user.email !event.type:transaction',
  119. orderby: 'count_unique(user)',
  120. },
  121. {
  122. name: t('Anonymous Users'),
  123. fields: ['count_unique(user)'],
  124. aggregates: ['count_unique(user)'],
  125. columns: [],
  126. conditions: '!has:user.email !event.type:transaction',
  127. orderby: 'count_unique(user)',
  128. },
  129. ],
  130. },
  131. {
  132. title: t('Handled vs. Unhandled'),
  133. displayType: DisplayType.LINE,
  134. interval: '5m',
  135. widgetType: WidgetType.DISCOVER,
  136. tempId: uniqueId(),
  137. layout: {
  138. h: 2,
  139. minH: 2,
  140. w: 1,
  141. x: 0,
  142. y: 2,
  143. },
  144. queries: [
  145. {
  146. name: t('Handled'),
  147. fields: ['count()'],
  148. aggregates: ['count()'],
  149. columns: [],
  150. conditions: 'error.handled:true',
  151. orderby: 'count()',
  152. },
  153. {
  154. name: t('Unhandled'),
  155. fields: ['count()'],
  156. aggregates: ['count()'],
  157. columns: [],
  158. conditions: 'error.handled:false',
  159. orderby: 'count()',
  160. },
  161. ],
  162. },
  163. {
  164. title: t('Errors by Country'),
  165. displayType: DisplayType.TABLE,
  166. interval: '5m',
  167. widgetType: WidgetType.DISCOVER,
  168. tempId: uniqueId(),
  169. layout: {
  170. h: 4,
  171. minH: 2,
  172. w: 2,
  173. x: 4,
  174. y: 6,
  175. },
  176. queries: [
  177. {
  178. name: '',
  179. fields: ['geo.country_code', 'geo.region', 'count()'],
  180. aggregates: ['count()'],
  181. columns: ['geo.country_code', 'geo.region'],
  182. conditions: '!event.type:transaction has:geo.country_code',
  183. orderby: 'count()',
  184. },
  185. ],
  186. },
  187. {
  188. title: t('High Throughput Transactions'),
  189. displayType: DisplayType.TABLE,
  190. interval: '5m',
  191. widgetType: WidgetType.DISCOVER,
  192. tempId: uniqueId(),
  193. layout: {
  194. h: 4,
  195. minH: 2,
  196. w: 2,
  197. x: 0,
  198. y: 6,
  199. },
  200. queries: [
  201. {
  202. name: '',
  203. fields: ['count()', 'transaction'],
  204. aggregates: ['count()'],
  205. columns: ['transaction'],
  206. conditions: 'event.type:transaction',
  207. orderby: '-count()',
  208. },
  209. ],
  210. },
  211. {
  212. title: t('Errors by Browser'),
  213. displayType: DisplayType.TABLE,
  214. interval: '5m',
  215. widgetType: WidgetType.DISCOVER,
  216. tempId: uniqueId(),
  217. layout: {
  218. h: 4,
  219. minH: 2,
  220. w: 1,
  221. x: 5,
  222. y: 2,
  223. },
  224. queries: [
  225. {
  226. name: '',
  227. fields: ['browser.name', 'count()'],
  228. aggregates: ['count()'],
  229. columns: ['browser.name'],
  230. conditions: '!event.type:transaction has:browser.name',
  231. orderby: '-count()',
  232. },
  233. ],
  234. },
  235. {
  236. title: t('Overall User Misery'),
  237. displayType: DisplayType.BIG_NUMBER,
  238. interval: '5m',
  239. widgetType: WidgetType.DISCOVER,
  240. tempId: uniqueId(),
  241. layout: {
  242. h: 1,
  243. minH: 1,
  244. w: 1,
  245. x: 0,
  246. y: 1,
  247. },
  248. queries: [
  249. {
  250. name: '',
  251. fields: ['user_misery(300)'],
  252. aggregates: ['user_misery(300)'],
  253. columns: [],
  254. conditions: '',
  255. orderby: '',
  256. },
  257. ],
  258. },
  259. {
  260. title: t('Overall Apdex'),
  261. displayType: DisplayType.BIG_NUMBER,
  262. interval: '5m',
  263. widgetType: WidgetType.DISCOVER,
  264. tempId: uniqueId(),
  265. layout: {
  266. h: 1,
  267. minH: 1,
  268. w: 1,
  269. x: 1,
  270. y: 1,
  271. },
  272. queries: [
  273. {
  274. name: '',
  275. fields: ['apdex(300)'],
  276. aggregates: ['apdex(300)'],
  277. columns: [],
  278. conditions: '',
  279. orderby: '',
  280. },
  281. ],
  282. },
  283. {
  284. title: t('High Throughput Transactions'),
  285. displayType: DisplayType.TOP_N,
  286. interval: '5m',
  287. widgetType: WidgetType.DISCOVER,
  288. tempId: uniqueId(),
  289. layout: {
  290. h: 2,
  291. minH: 2,
  292. w: 2,
  293. x: 0,
  294. y: 4,
  295. },
  296. queries: [
  297. {
  298. name: '',
  299. fields: ['transaction', 'count()'],
  300. aggregates: ['count()'],
  301. columns: ['transaction'],
  302. conditions: 'event.type:transaction',
  303. orderby: '-count()',
  304. },
  305. ],
  306. },
  307. {
  308. title: t('Issues Assigned to Me or My Teams'),
  309. displayType: DisplayType.TABLE,
  310. interval: '5m',
  311. widgetType: WidgetType.ISSUE,
  312. tempId: uniqueId(),
  313. layout: {
  314. h: 4,
  315. minH: 2,
  316. w: 2,
  317. x: 2,
  318. y: 2,
  319. },
  320. queries: [
  321. {
  322. name: '',
  323. fields: ['assignee', 'issue', 'title'],
  324. aggregates: [],
  325. columns: ['assignee', 'issue', 'title'],
  326. conditions: 'assigned_or_suggested:me is:unresolved',
  327. orderby: 'trends',
  328. },
  329. ],
  330. },
  331. {
  332. title: t('Transactions Ordered by Misery'),
  333. displayType: DisplayType.TABLE,
  334. interval: '5m',
  335. widgetType: WidgetType.DISCOVER,
  336. tempId: uniqueId(),
  337. layout: {
  338. h: 4,
  339. minH: 2,
  340. w: 2,
  341. y: 6,
  342. x: 2,
  343. },
  344. queries: [
  345. {
  346. name: '',
  347. fields: ['transaction', 'user_misery(300)'],
  348. aggregates: ['user_misery(300)'],
  349. columns: ['transaction'],
  350. conditions: '',
  351. orderby: '-user_misery(300)',
  352. },
  353. ],
  354. },
  355. {
  356. title: t('Errors by Browser Over Time'),
  357. displayType: DisplayType.TOP_N,
  358. interval: '5m',
  359. widgetType: WidgetType.DISCOVER,
  360. tempId: uniqueId(),
  361. layout: {
  362. h: 4,
  363. minH: 2,
  364. w: 1,
  365. x: 4,
  366. y: 2,
  367. },
  368. queries: [
  369. {
  370. name: '',
  371. fields: ['browser.name', 'count()'],
  372. aggregates: ['count()'],
  373. columns: ['browser.name'],
  374. conditions: 'event.type:error has:browser.name',
  375. orderby: '-count()',
  376. },
  377. ],
  378. },
  379. ],
  380. },
  381. {
  382. id: 'frontend-template',
  383. title: t('Frontend Template'),
  384. dateCreated: '',
  385. createdBy: undefined,
  386. description: t('Erroring URLs and Web Vitals'),
  387. projects: [],
  388. filters: {},
  389. widgets: [
  390. {
  391. title: t('Top 5 Issues by Unique Users Over Time'),
  392. displayType: DisplayType.TOP_N,
  393. interval: '5m',
  394. widgetType: WidgetType.DISCOVER,
  395. tempId: uniqueId(),
  396. layout: {
  397. h: 2,
  398. minH: 2,
  399. w: 4,
  400. x: 0,
  401. y: 4,
  402. },
  403. queries: [
  404. {
  405. name: '',
  406. fields: ['issue', 'count_unique(user)'],
  407. aggregates: ['count_unique(user)'],
  408. columns: ['issue'],
  409. conditions: '',
  410. orderby: '-count_unique(user)',
  411. },
  412. ],
  413. },
  414. {
  415. title: t('Errors by Browser as Percentage'),
  416. displayType: DisplayType.AREA,
  417. interval: '5m',
  418. widgetType: WidgetType.DISCOVER,
  419. tempId: uniqueId(),
  420. layout: {
  421. h: 4,
  422. minH: 2,
  423. w: 2,
  424. x: 0,
  425. y: 9,
  426. },
  427. queries: [
  428. {
  429. name: '',
  430. fields: [
  431. 'equation|count_if(browser.name,equals,Chrome)/count() * 100',
  432. 'equation|count_if(browser.name,equals,Firefox)/count() * 100',
  433. 'equation|count_if(browser.name,equals,Safari)/count() * 100',
  434. ],
  435. aggregates: [
  436. 'equation|count_if(browser.name,equals,Chrome)/count() * 100',
  437. 'equation|count_if(browser.name,equals,Firefox)/count() * 100',
  438. 'equation|count_if(browser.name,equals,Safari)/count() * 100',
  439. ],
  440. columns: [],
  441. conditions: 'has:browser.name',
  442. orderby: '',
  443. },
  444. ],
  445. },
  446. {
  447. title: t('Issues Assigned to Me or My Teams'),
  448. displayType: DisplayType.TABLE,
  449. interval: '5m',
  450. widgetType: WidgetType.ISSUE,
  451. tempId: uniqueId(),
  452. layout: {
  453. h: 4,
  454. minH: 2,
  455. w: 2,
  456. x: 4,
  457. y: 4,
  458. },
  459. queries: [
  460. {
  461. name: '',
  462. fields: ['assignee', 'issue', 'title'],
  463. aggregates: [],
  464. columns: ['assignee', 'issue', 'title'],
  465. conditions: 'assigned_or_suggested:me is:unresolved',
  466. orderby: 'date',
  467. },
  468. ],
  469. },
  470. {
  471. title: t('Top 5 Issues by Unique Users'),
  472. displayType: DisplayType.TABLE,
  473. interval: '5m',
  474. widgetType: WidgetType.DISCOVER,
  475. tempId: uniqueId(),
  476. layout: {
  477. h: 3,
  478. minH: 2,
  479. w: 4,
  480. x: 0,
  481. y: 6,
  482. },
  483. queries: [
  484. {
  485. name: '',
  486. fields: ['issue', 'count_unique(user)', 'title'],
  487. aggregates: ['count_unique(user)'],
  488. columns: ['issue', 'title'],
  489. conditions: '',
  490. orderby: '-count_unique(user)',
  491. },
  492. ],
  493. },
  494. {
  495. title: t('URLs grouped by Issue'),
  496. displayType: DisplayType.TABLE,
  497. interval: '5m',
  498. widgetType: WidgetType.DISCOVER,
  499. tempId: uniqueId(),
  500. layout: {
  501. h: 5,
  502. minH: 2,
  503. w: 2,
  504. x: 4,
  505. y: 8,
  506. },
  507. queries: [
  508. {
  509. name: '',
  510. fields: ['http.url', 'issue', 'count_unique(user)'],
  511. aggregates: ['count_unique(user)'],
  512. columns: ['http.url', 'issue'],
  513. conditions: 'event.type:error',
  514. orderby: '-count_unique(user)',
  515. },
  516. ],
  517. },
  518. {
  519. title: t('Transactions 404ing'),
  520. displayType: DisplayType.TABLE,
  521. interval: '5m',
  522. widgetType: WidgetType.DISCOVER,
  523. tempId: uniqueId(),
  524. layout: {
  525. h: 4,
  526. minH: 2,
  527. w: 2,
  528. x: 2,
  529. y: 9,
  530. },
  531. queries: [
  532. {
  533. name: '',
  534. fields: ['transaction', 'count()'],
  535. aggregates: ['count()'],
  536. columns: ['transaction'],
  537. conditions: 'transaction.status:not_found',
  538. orderby: '-count()',
  539. },
  540. ],
  541. },
  542. {
  543. title: t('Layout Shift Over Time'),
  544. displayType: DisplayType.LINE,
  545. interval: '5m',
  546. widgetType: WidgetType.DISCOVER,
  547. tempId: uniqueId(),
  548. layout: {
  549. h: 2,
  550. minH: 2,
  551. w: 1,
  552. x: 2,
  553. y: 0,
  554. },
  555. queries: [
  556. {
  557. name: '',
  558. fields: ['p75(measurements.cls)'],
  559. aggregates: ['p75(measurements.cls)'],
  560. columns: [],
  561. conditions: '',
  562. orderby: '',
  563. },
  564. ],
  565. },
  566. {
  567. title: t('LCP by Country'),
  568. displayType: DisplayType.TABLE,
  569. interval: '5m',
  570. widgetType: WidgetType.DISCOVER,
  571. tempId: uniqueId(),
  572. layout: {
  573. h: 2,
  574. minH: 2,
  575. w: 2,
  576. x: 2,
  577. y: 2,
  578. },
  579. queries: [
  580. {
  581. name: '',
  582. fields: ['geo.country_code', 'geo.region', 'p75(measurements.lcp)'],
  583. aggregates: ['p75(measurements.lcp)'],
  584. columns: ['geo.country_code', 'geo.region'],
  585. conditions: 'has:geo.country_code',
  586. orderby: '-p75(measurements.lcp)',
  587. },
  588. ],
  589. },
  590. {
  591. title: t('Page Load Over Time'),
  592. displayType: DisplayType.LINE,
  593. interval: '5m',
  594. widgetType: WidgetType.DISCOVER,
  595. tempId: uniqueId(),
  596. layout: {
  597. h: 2,
  598. minH: 2,
  599. w: 1,
  600. x: 3,
  601. y: 0,
  602. },
  603. queries: [
  604. {
  605. name: '',
  606. fields: ['p75(measurements.lcp)', 'p75(measurements.fcp)'],
  607. aggregates: ['p75(measurements.lcp)', 'p75(measurements.fcp)'],
  608. columns: [],
  609. conditions: 'transaction.op:pageload',
  610. orderby: '',
  611. },
  612. ],
  613. },
  614. {
  615. title: t('Slowest Pageloads'),
  616. displayType: DisplayType.TABLE,
  617. interval: '5m',
  618. layout: {
  619. h: 2,
  620. minH: 2,
  621. w: 2,
  622. x: 0,
  623. y: 2,
  624. },
  625. queries: [
  626. {
  627. name: '',
  628. fields: ['transaction', 'count()'],
  629. aggregates: ['count()'],
  630. columns: ['transaction'],
  631. conditions: 'transaction.op:pageload p75(measurements.lcp):>4s',
  632. orderby: '-count()',
  633. },
  634. ],
  635. },
  636. {
  637. title: t('Overall LCP'),
  638. displayType: DisplayType.BIG_NUMBER,
  639. interval: '5m',
  640. widgetType: WidgetType.DISCOVER,
  641. tempId: uniqueId(),
  642. layout: {
  643. h: 1,
  644. minH: 1,
  645. w: 1,
  646. x: 0,
  647. y: 0,
  648. },
  649. queries: [
  650. {
  651. name: '',
  652. fields: ['p75(measurements.lcp)'],
  653. aggregates: ['p75(measurements.lcp)'],
  654. columns: [],
  655. conditions: '',
  656. orderby: '',
  657. },
  658. ],
  659. },
  660. {
  661. title: t('Slow Page Navigations'),
  662. displayType: DisplayType.TABLE,
  663. interval: '5m',
  664. widgetType: WidgetType.DISCOVER,
  665. tempId: uniqueId(),
  666. layout: {
  667. h: 4,
  668. minH: 2,
  669. w: 2,
  670. x: 4,
  671. y: 0,
  672. },
  673. queries: [
  674. {
  675. name: '',
  676. fields: ['transaction', 'count()'],
  677. aggregates: ['count()'],
  678. columns: ['transaction'],
  679. conditions: 'transaction.duration:>2s',
  680. orderby: '-count()',
  681. },
  682. ],
  683. },
  684. {
  685. title: t('Overall FCP'),
  686. displayType: DisplayType.BIG_NUMBER,
  687. interval: '5m',
  688. widgetType: WidgetType.DISCOVER,
  689. tempId: uniqueId(),
  690. layout: {
  691. h: 1,
  692. minH: 1,
  693. w: 1,
  694. x: 1,
  695. y: 0,
  696. },
  697. queries: [
  698. {
  699. name: '',
  700. fields: ['p75(measurements.fcp)'],
  701. aggregates: ['p75(measurements.fcp)'],
  702. columns: [],
  703. conditions: '',
  704. orderby: '',
  705. },
  706. ],
  707. },
  708. {
  709. title: t('Overall CLS'),
  710. displayType: DisplayType.BIG_NUMBER,
  711. interval: '5m',
  712. widgetType: WidgetType.DISCOVER,
  713. tempId: uniqueId(),
  714. layout: {
  715. h: 1,
  716. minH: 1,
  717. w: 1,
  718. x: 0,
  719. y: 1,
  720. },
  721. queries: [
  722. {
  723. name: '',
  724. fields: ['p75(measurements.cls)'],
  725. aggregates: ['p75(measurements.cls)'],
  726. columns: [],
  727. conditions: '',
  728. orderby: '',
  729. },
  730. ],
  731. },
  732. {
  733. title: t('Overall FID'),
  734. displayType: DisplayType.BIG_NUMBER,
  735. interval: '5m',
  736. widgetType: WidgetType.DISCOVER,
  737. tempId: uniqueId(),
  738. layout: {
  739. h: 1,
  740. minH: 1,
  741. w: 1,
  742. x: 1,
  743. y: 1,
  744. },
  745. queries: [
  746. {
  747. name: '',
  748. fields: ['p75(measurements.fid)'],
  749. aggregates: ['p75(measurements.fid)'],
  750. columns: [],
  751. conditions: '',
  752. orderby: '',
  753. },
  754. ],
  755. },
  756. ],
  757. },
  758. {
  759. id: 'backend-template',
  760. title: t('Backend Template'),
  761. dateCreated: '',
  762. createdBy: undefined,
  763. description: t('Issues and Performance'),
  764. projects: [],
  765. filters: {},
  766. widgets: [
  767. {
  768. title: t('Top 5 Issues by Unique Users Over Time'),
  769. displayType: DisplayType.TOP_N,
  770. interval: '5m',
  771. widgetType: WidgetType.DISCOVER,
  772. tempId: uniqueId(),
  773. layout: {
  774. h: 4,
  775. minH: 2,
  776. w: 2,
  777. x: 0,
  778. y: 6,
  779. },
  780. queries: [
  781. {
  782. name: '',
  783. fields: ['issue', 'count_unique(user)'],
  784. aggregates: ['count_unique(user)'],
  785. columns: ['issue'],
  786. conditions: '',
  787. orderby: '-count_unique(user)',
  788. },
  789. ],
  790. },
  791. {
  792. title: t('Transactions Erroring Over Time'),
  793. displayType: DisplayType.TOP_N,
  794. interval: '5m',
  795. widgetType: WidgetType.DISCOVER,
  796. tempId: uniqueId(),
  797. layout: {
  798. h: 2,
  799. minH: 2,
  800. w: 4,
  801. x: 2,
  802. y: 8,
  803. },
  804. queries: [
  805. {
  806. name: '',
  807. fields: ['transaction', 'count()'],
  808. aggregates: ['count()'],
  809. columns: ['transaction'],
  810. conditions: 'transaction.status:internal_error',
  811. orderby: '-count()',
  812. },
  813. ],
  814. },
  815. {
  816. title: t('Erroring Transactions by Percentage'),
  817. displayType: DisplayType.TABLE,
  818. interval: '5m',
  819. widgetType: WidgetType.DISCOVER,
  820. tempId: uniqueId(),
  821. layout: {
  822. h: 5,
  823. minH: 2,
  824. w: 2,
  825. x: 4,
  826. y: 10,
  827. },
  828. queries: [
  829. {
  830. name: '',
  831. fields: [
  832. 'equation|count_if(transaction.status,equals,internal_error) / count() * 100',
  833. 'transaction',
  834. 'count_if(transaction.status,equals,internal_error)',
  835. 'count()',
  836. ],
  837. aggregates: [
  838. 'equation|count_if(transaction.status,equals,internal_error) / count() * 100',
  839. 'count_if(transaction.status,equals,internal_error)',
  840. 'count()',
  841. ],
  842. columns: ['transaction'],
  843. conditions: 'count():>100',
  844. orderby: '-equation[0]',
  845. },
  846. ],
  847. },
  848. {
  849. title: t('Top 5 Issues by Unique Users'),
  850. displayType: DisplayType.TABLE,
  851. interval: '5m',
  852. widgetType: WidgetType.DISCOVER,
  853. tempId: uniqueId(),
  854. layout: {
  855. h: 5,
  856. minH: 2,
  857. w: 2,
  858. x: 0,
  859. y: 10,
  860. },
  861. queries: [
  862. {
  863. name: '',
  864. fields: ['issue', 'count_unique(user)', 'title'],
  865. aggregates: ['count_unique(user)'],
  866. columns: ['issue', 'title'],
  867. conditions: '',
  868. orderby: '-count_unique(user)',
  869. },
  870. ],
  871. },
  872. {
  873. title: t('Transactions Erroring'),
  874. displayType: DisplayType.TABLE,
  875. interval: '5m',
  876. widgetType: WidgetType.DISCOVER,
  877. tempId: uniqueId(),
  878. layout: {
  879. h: 5,
  880. minH: 2,
  881. w: 2,
  882. x: 2,
  883. y: 10,
  884. },
  885. queries: [
  886. {
  887. name: '',
  888. fields: ['count()', 'transaction'],
  889. aggregates: ['count()'],
  890. columns: ['transaction'],
  891. conditions: 'transaction.status:internal_error',
  892. orderby: '-count()',
  893. },
  894. ],
  895. },
  896. {
  897. title: t('Issues Assigned to Me or My Teams'),
  898. displayType: DisplayType.TABLE,
  899. interval: '5m',
  900. widgetType: WidgetType.ISSUE,
  901. tempId: uniqueId(),
  902. layout: {
  903. h: 7,
  904. minH: 2,
  905. w: 6,
  906. x: 0,
  907. y: 15,
  908. },
  909. queries: [
  910. {
  911. name: '',
  912. fields: ['assignee', 'issue', 'title'],
  913. aggregates: [],
  914. columns: ['assignee', 'issue', 'title'],
  915. conditions: 'assigned_or_suggested:me is:unresolved',
  916. orderby: 'date',
  917. },
  918. ],
  919. },
  920. {
  921. title: t('p75 Over Time'),
  922. displayType: DisplayType.LINE,
  923. interval: '5m',
  924. widgetType: WidgetType.DISCOVER,
  925. tempId: uniqueId(),
  926. layout: {
  927. h: 2,
  928. minH: 2,
  929. w: 4,
  930. x: 2,
  931. y: 2,
  932. },
  933. queries: [
  934. {
  935. name: '',
  936. fields: ['p75(transaction.duration)'],
  937. aggregates: ['p75(transaction.duration)'],
  938. columns: [],
  939. conditions: '',
  940. orderby: '',
  941. },
  942. ],
  943. },
  944. {
  945. title: t('Throughput (Events Per Minute)'),
  946. displayType: DisplayType.LINE,
  947. interval: '5m',
  948. widgetType: WidgetType.DISCOVER,
  949. tempId: uniqueId(),
  950. layout: {
  951. h: 2,
  952. minH: 2,
  953. w: 4,
  954. x: 2,
  955. y: 0,
  956. },
  957. queries: [
  958. {
  959. name: 'Transactions',
  960. fields: ['epm()'],
  961. aggregates: ['epm()'],
  962. columns: [],
  963. conditions: 'event.type:transaction',
  964. orderby: '',
  965. },
  966. {
  967. name: 'Errors',
  968. fields: ['epm()'],
  969. aggregates: ['epm()'],
  970. columns: [],
  971. conditions: 'event.type:error',
  972. orderby: '',
  973. },
  974. ],
  975. },
  976. {
  977. title: t('Tasks Transactions with Poor Apdex'),
  978. displayType: DisplayType.TABLE,
  979. interval: '5m',
  980. widgetType: WidgetType.DISCOVER,
  981. tempId: uniqueId(),
  982. layout: {
  983. h: 4,
  984. minH: 2,
  985. w: 2,
  986. x: 0,
  987. y: 2,
  988. },
  989. queries: [
  990. {
  991. name: '',
  992. fields: ['count()', 'transaction'],
  993. aggregates: ['count()'],
  994. columns: ['transaction'],
  995. conditions: 'apdex():<0.5 transaction.op:*task*',
  996. orderby: '-count()',
  997. },
  998. ],
  999. },
  1000. {
  1001. title: t('HTTP Transactions with Poor Apdex'),
  1002. displayType: DisplayType.TABLE,
  1003. interval: '5m',
  1004. widgetType: WidgetType.DISCOVER,
  1005. tempId: uniqueId(),
  1006. layout: {
  1007. h: 4,
  1008. minH: 2,
  1009. w: 4,
  1010. x: 2,
  1011. y: 4,
  1012. },
  1013. queries: [
  1014. {
  1015. name: '',
  1016. fields: ['epm()', 'http.method', 'http.status_code', 'transaction'],
  1017. aggregates: ['epm()'],
  1018. columns: ['http.method', 'http.status_code', 'transaction'],
  1019. conditions:
  1020. 'apdex():<0.5 transaction.op:*http* has:http.method has:http.status_code',
  1021. orderby: '-epm()',
  1022. },
  1023. ],
  1024. },
  1025. {
  1026. title: t('Overall Apdex'),
  1027. displayType: DisplayType.BIG_NUMBER,
  1028. interval: '5m',
  1029. widgetType: WidgetType.DISCOVER,
  1030. tempId: uniqueId(),
  1031. layout: {
  1032. h: 1,
  1033. minH: 1,
  1034. w: 1,
  1035. x: 0,
  1036. y: 0,
  1037. },
  1038. queries: [
  1039. {
  1040. name: '',
  1041. fields: ['apdex(300)'],
  1042. aggregates: ['apdex(300)'],
  1043. columns: [],
  1044. conditions: '',
  1045. orderby: '',
  1046. },
  1047. ],
  1048. },
  1049. {
  1050. title: t('Overall Duration'),
  1051. displayType: DisplayType.BIG_NUMBER,
  1052. interval: '5m',
  1053. widgetType: WidgetType.DISCOVER,
  1054. tempId: uniqueId(),
  1055. layout: {
  1056. h: 1,
  1057. minH: 1,
  1058. w: 1,
  1059. x: 1,
  1060. y: 0,
  1061. },
  1062. queries: [
  1063. {
  1064. name: '',
  1065. fields: ['p75(transaction.duration)'],
  1066. aggregates: ['p75(transaction.duration)'],
  1067. columns: [],
  1068. conditions: '',
  1069. orderby: '',
  1070. },
  1071. ],
  1072. },
  1073. {
  1074. title: t('Overall HTTP Spans'),
  1075. displayType: DisplayType.BIG_NUMBER,
  1076. interval: '5m',
  1077. widgetType: WidgetType.DISCOVER,
  1078. tempId: uniqueId(),
  1079. layout: {
  1080. h: 1,
  1081. minH: 1,
  1082. w: 1,
  1083. x: 0,
  1084. y: 1,
  1085. },
  1086. queries: [
  1087. {
  1088. name: '',
  1089. fields: ['p75(spans.http)'],
  1090. aggregates: ['p75(spans.http)'],
  1091. columns: [],
  1092. conditions: '',
  1093. orderby: '',
  1094. },
  1095. ],
  1096. },
  1097. {
  1098. title: t('Overall DB Spans'),
  1099. displayType: DisplayType.BIG_NUMBER,
  1100. interval: '5m',
  1101. widgetType: WidgetType.DISCOVER,
  1102. tempId: uniqueId(),
  1103. layout: {
  1104. h: 1,
  1105. minH: 1,
  1106. w: 1,
  1107. x: 1,
  1108. y: 1,
  1109. },
  1110. queries: [
  1111. {
  1112. name: '',
  1113. fields: ['p75(spans.db)'],
  1114. aggregates: ['p75(spans.db)'],
  1115. columns: [],
  1116. conditions: '',
  1117. orderby: '',
  1118. },
  1119. ],
  1120. },
  1121. ],
  1122. },
  1123. {
  1124. id: 'mobile-template',
  1125. title: t('Mobile Template'),
  1126. dateCreated: '',
  1127. createdBy: undefined,
  1128. description: t('Crash Details and Performance Vitals'),
  1129. projects: [],
  1130. filters: {},
  1131. widgets: [
  1132. {
  1133. title: t('Total Crashes'),
  1134. displayType: DisplayType.BIG_NUMBER,
  1135. interval: '5m',
  1136. widgetType: WidgetType.DISCOVER,
  1137. tempId: uniqueId(),
  1138. layout: {
  1139. h: 1,
  1140. minH: 1,
  1141. w: 1,
  1142. x: 0,
  1143. y: 0,
  1144. },
  1145. queries: [
  1146. {
  1147. name: '',
  1148. fields: ['count()'],
  1149. aggregates: ['count()'],
  1150. columns: [],
  1151. conditions: 'error.handled:false event.type:error',
  1152. orderby: '',
  1153. },
  1154. ],
  1155. },
  1156. {
  1157. title: t('Unique Users Who Crashed'),
  1158. displayType: DisplayType.BIG_NUMBER,
  1159. interval: '5m',
  1160. widgetType: WidgetType.DISCOVER,
  1161. tempId: uniqueId(),
  1162. layout: {
  1163. h: 1,
  1164. minH: 1,
  1165. w: 1,
  1166. x: 1,
  1167. y: 0,
  1168. },
  1169. queries: [
  1170. {
  1171. name: '',
  1172. fields: ['count_unique(user)'],
  1173. aggregates: ['count_unique(user)'],
  1174. columns: [],
  1175. conditions: 'error.handled:false event.type:error',
  1176. orderby: '',
  1177. },
  1178. ],
  1179. },
  1180. {
  1181. title: t('Unique Issues Causing Crashes'),
  1182. displayType: DisplayType.BIG_NUMBER,
  1183. interval: '5m',
  1184. widgetType: WidgetType.DISCOVER,
  1185. tempId: uniqueId(),
  1186. layout: {
  1187. h: 1,
  1188. minH: 1,
  1189. w: 1,
  1190. x: 2,
  1191. y: 0,
  1192. },
  1193. queries: [
  1194. {
  1195. name: '',
  1196. fields: ['count_unique(issue)'],
  1197. aggregates: ['count_unique(issue)'],
  1198. columns: [],
  1199. conditions: 'error.handled:false event.type:error',
  1200. orderby: '',
  1201. },
  1202. ],
  1203. },
  1204. {
  1205. title: t('Overall Number of Errors'),
  1206. displayType: DisplayType.BIG_NUMBER,
  1207. interval: '5m',
  1208. widgetType: WidgetType.DISCOVER,
  1209. tempId: uniqueId(),
  1210. layout: {
  1211. h: 1,
  1212. minH: 1,
  1213. w: 1,
  1214. x: 3,
  1215. y: 0,
  1216. },
  1217. queries: [
  1218. {
  1219. name: '',
  1220. fields: ['count()'],
  1221. aggregates: ['count()'],
  1222. columns: [],
  1223. conditions: 'event.type:error',
  1224. orderby: '',
  1225. },
  1226. ],
  1227. },
  1228. {
  1229. title: t('Issues Causing Crashes'),
  1230. displayType: DisplayType.TABLE,
  1231. interval: '5m',
  1232. widgetType: WidgetType.DISCOVER,
  1233. tempId: uniqueId(),
  1234. layout: {
  1235. h: 2,
  1236. minH: 2,
  1237. w: 3,
  1238. x: 0,
  1239. y: 1,
  1240. },
  1241. queries: [
  1242. {
  1243. name: '',
  1244. fields: ['issue', 'count()', 'count_unique(user)'],
  1245. aggregates: ['count()', 'count_unique(user)'],
  1246. columns: ['issue'],
  1247. conditions: 'error.handled:false',
  1248. orderby: '-count_unique(user)',
  1249. },
  1250. ],
  1251. },
  1252. {
  1253. title: t('Crashes Over Time'),
  1254. displayType: DisplayType.LINE,
  1255. interval: '5m',
  1256. widgetType: WidgetType.DISCOVER,
  1257. tempId: uniqueId(),
  1258. layout: {
  1259. h: 3,
  1260. minH: 2,
  1261. w: 2,
  1262. x: 4,
  1263. y: 0,
  1264. },
  1265. queries: [
  1266. {
  1267. name: t('Crashes'),
  1268. fields: ['count()', 'count_unique(user)'],
  1269. aggregates: ['count()', 'count_unique(user)'],
  1270. columns: [],
  1271. conditions: 'error.handled:false',
  1272. orderby: '',
  1273. },
  1274. ],
  1275. },
  1276. {
  1277. title: t('Crashes by OS'),
  1278. displayType: DisplayType.TABLE,
  1279. interval: '5m',
  1280. widgetType: WidgetType.DISCOVER,
  1281. tempId: uniqueId(),
  1282. layout: {
  1283. h: 2,
  1284. minH: 2,
  1285. w: 1,
  1286. x: 3,
  1287. y: 1,
  1288. },
  1289. queries: [
  1290. {
  1291. name: '',
  1292. fields: ['os', 'count()'],
  1293. aggregates: ['count()'],
  1294. columns: ['os'],
  1295. conditions: 'has:os error.handled:false',
  1296. orderby: '-count()',
  1297. },
  1298. ],
  1299. },
  1300. {
  1301. title: t('Overall Warm Startup Time'),
  1302. displayType: DisplayType.BIG_NUMBER,
  1303. interval: '5m',
  1304. widgetType: WidgetType.DISCOVER,
  1305. tempId: uniqueId(),
  1306. layout: {
  1307. h: 1,
  1308. minH: 1,
  1309. w: 1,
  1310. x: 0,
  1311. y: 3,
  1312. },
  1313. queries: [
  1314. {
  1315. name: '',
  1316. fields: ['p75(measurements.app_start_warm)'],
  1317. aggregates: ['p75(measurements.app_start_warm)'],
  1318. columns: [],
  1319. conditions: 'has:measurements.app_start_warm',
  1320. orderby: '',
  1321. },
  1322. ],
  1323. },
  1324. {
  1325. title: t('Overall Cold Startup Time'),
  1326. displayType: DisplayType.BIG_NUMBER,
  1327. interval: '5m',
  1328. widgetType: WidgetType.DISCOVER,
  1329. tempId: uniqueId(),
  1330. layout: {
  1331. h: 1,
  1332. minH: 1,
  1333. w: 1,
  1334. x: 2,
  1335. y: 3,
  1336. },
  1337. queries: [
  1338. {
  1339. name: '',
  1340. fields: ['p75(measurements.app_start_cold)'],
  1341. aggregates: ['p75(measurements.app_start_cold)'],
  1342. columns: [],
  1343. conditions: 'has:measurements.app_start_cold',
  1344. orderby: '',
  1345. },
  1346. ],
  1347. },
  1348. {
  1349. title: t('Warm Startup Times'),
  1350. displayType: DisplayType.TABLE,
  1351. interval: '5m',
  1352. widgetType: WidgetType.DISCOVER,
  1353. tempId: uniqueId(),
  1354. layout: {
  1355. h: 4,
  1356. minH: 2,
  1357. w: 2,
  1358. x: 0,
  1359. y: 4,
  1360. },
  1361. queries: [
  1362. {
  1363. name: '',
  1364. fields: ['transaction', 'p75(measurements.app_start_warm)'],
  1365. aggregates: ['p75(measurements.app_start_warm)'],
  1366. columns: ['transaction'],
  1367. conditions: 'has:measurements.app_start_warm',
  1368. orderby: '-p75(measurements.app_start_warm)',
  1369. },
  1370. ],
  1371. },
  1372. {
  1373. title: t('Cold Startup Times'),
  1374. displayType: DisplayType.TABLE,
  1375. interval: '5m',
  1376. widgetType: WidgetType.DISCOVER,
  1377. tempId: uniqueId(),
  1378. layout: {
  1379. h: 4,
  1380. minH: 2,
  1381. w: 2,
  1382. x: 2,
  1383. y: 4,
  1384. },
  1385. queries: [
  1386. {
  1387. name: '',
  1388. fields: ['transaction', 'p75(measurements.app_start_cold)'],
  1389. aggregates: ['p75(measurements.app_start_cold)'],
  1390. columns: ['transaction'],
  1391. conditions: 'has:measurements.app_start_cold',
  1392. orderby: '-p75(measurements.app_start_cold)',
  1393. },
  1394. ],
  1395. },
  1396. {
  1397. title: t('Overall Frozen Frames'),
  1398. displayType: DisplayType.BIG_NUMBER,
  1399. interval: '5m',
  1400. widgetType: WidgetType.DISCOVER,
  1401. tempId: uniqueId(),
  1402. layout: {
  1403. h: 1,
  1404. minH: 1,
  1405. w: 1,
  1406. x: 4,
  1407. y: 3,
  1408. },
  1409. queries: [
  1410. {
  1411. name: '',
  1412. fields: ['p75(measurements.frames_frozen_rate)'],
  1413. aggregates: ['p75(measurements.frames_frozen_rate)'],
  1414. columns: [],
  1415. conditions: '',
  1416. orderby: '',
  1417. },
  1418. ],
  1419. },
  1420. {
  1421. title: t('Max Warm Startup Time'),
  1422. displayType: DisplayType.BIG_NUMBER,
  1423. interval: '5m',
  1424. widgetType: WidgetType.DISCOVER,
  1425. tempId: uniqueId(),
  1426. layout: {
  1427. h: 1,
  1428. minH: 1,
  1429. w: 1,
  1430. x: 1,
  1431. y: 3,
  1432. },
  1433. queries: [
  1434. {
  1435. name: '',
  1436. fields: ['max(measurements.app_start_warm)'],
  1437. aggregates: ['max(measurements.app_start_warm)'],
  1438. columns: [],
  1439. conditions: '',
  1440. orderby: '',
  1441. },
  1442. ],
  1443. },
  1444. {
  1445. title: t('Max Cold Startup Time'),
  1446. displayType: DisplayType.BIG_NUMBER,
  1447. interval: '5m',
  1448. widgetType: WidgetType.DISCOVER,
  1449. tempId: uniqueId(),
  1450. layout: {
  1451. h: 1,
  1452. minH: 1,
  1453. w: 1,
  1454. x: 3,
  1455. y: 3,
  1456. },
  1457. queries: [
  1458. {
  1459. name: '',
  1460. fields: ['max(measurements.app_start_cold)'],
  1461. aggregates: ['max(measurements.app_start_cold)'],
  1462. columns: [],
  1463. conditions: '',
  1464. orderby: '',
  1465. },
  1466. ],
  1467. },
  1468. {
  1469. title: t('Frozen Frames Rate'),
  1470. displayType: DisplayType.TABLE,
  1471. interval: '5m',
  1472. widgetType: WidgetType.DISCOVER,
  1473. tempId: uniqueId(),
  1474. layout: {
  1475. h: 4,
  1476. minH: 2,
  1477. w: 2,
  1478. x: 4,
  1479. y: 4,
  1480. },
  1481. queries: [
  1482. {
  1483. name: '',
  1484. fields: ['transaction', 'p75(measurements.frames_frozen_rate)'],
  1485. aggregates: ['p75(measurements.frames_frozen_rate)'],
  1486. columns: ['transaction'],
  1487. conditions: 'has:measurements.frames_frozen_rate',
  1488. orderby: '-p75(measurements.frames_frozen_rate)',
  1489. },
  1490. ],
  1491. },
  1492. ],
  1493. },
  1494. ];
  1495. export const DISPLAY_TYPE_CHOICES = [
  1496. {label: t('Area Chart'), value: 'area'},
  1497. {label: t('Bar Chart'), value: 'bar'},
  1498. {label: t('Line Chart'), value: 'line'},
  1499. {label: t('Table'), value: 'table'},
  1500. {label: t('Big Number'), value: 'big_number'},
  1501. {label: t('Top 5 Events'), value: 'top_n'},
  1502. ];
  1503. export const INTERVAL_CHOICES = [
  1504. {label: t('1 Minute'), value: '1m'},
  1505. {label: t('5 Minutes'), value: '5m'},
  1506. {label: t('15 Minutes'), value: '15m'},
  1507. {label: t('30 Minutes'), value: '30m'},
  1508. {label: t('1 Hour'), value: '1h'},
  1509. {label: t('1 Day'), value: '1d'},
  1510. ];
  1511. export const DEFAULT_STATS_PERIOD = '24h';