data.tsx 37 KB

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