data.tsx 46 KB

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