data.tsx 37 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518
  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.WORLD_MAP,
  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: ['count()'],
  179. aggregates: ['count()'],
  180. columns: [],
  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.WORLD_MAP,
  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: ['p75(measurements.lcp)'],
  582. aggregates: ['p75(measurements.lcp)'],
  583. columns: [],
  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('World Map'), value: 'world_map'},
  1500. {label: t('Big Number'), value: 'big_number'},
  1501. {label: t('Top 5 Events'), value: 'top_n'},
  1502. ];
  1503. export const INTERVAL_CHOICES = [
  1504. {label: t('1 Minute'), value: '1m'},
  1505. {label: t('5 Minutes'), value: '5m'},
  1506. {label: t('15 Minutes'), value: '15m'},
  1507. {label: t('30 Minutes'), value: '30m'},
  1508. {label: t('1 Hour'), value: '1h'},
  1509. {label: t('1 Day'), value: '1d'},
  1510. ];
  1511. export const DEFAULT_STATS_PERIOD = '24h';