data.tsx 37 KB

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