|
| 1 | +import {t} from 'sentry/locale'; |
| 2 | +import {IssueType} from 'sentry/types/group'; |
| 3 | +import type {IssueCategoryConfigMapping} from 'sentry/utils/issueTypeConfig/types'; |
| 4 | +import {Tab} from 'sentry/views/issueDetails/types'; |
| 5 | + |
| 6 | +const performanceBestPracticeConfig: IssueCategoryConfigMapping = { |
| 7 | + _categoryDefaults: { |
| 8 | + actions: { |
| 9 | + archiveUntilOccurrence: {enabled: true}, |
| 10 | + delete: { |
| 11 | + enabled: false, |
| 12 | + disabledReason: t('Not yet supported for performance issues'), |
| 13 | + }, |
| 14 | + deleteAndDiscard: { |
| 15 | + enabled: false, |
| 16 | + disabledReason: t('Not yet supported for performance issues'), |
| 17 | + }, |
| 18 | + merge: { |
| 19 | + enabled: false, |
| 20 | + disabledReason: t('Not yet supported for performance issues'), |
| 21 | + }, |
| 22 | + ignore: {enabled: true}, |
| 23 | + resolve: {enabled: true}, |
| 24 | + resolveInRelease: {enabled: true}, |
| 25 | + share: {enabled: true}, |
| 26 | + }, |
| 27 | + pages: { |
| 28 | + landingPage: Tab.DETAILS, |
| 29 | + events: {enabled: true}, |
| 30 | + openPeriods: {enabled: false}, |
| 31 | + checkIns: {enabled: false}, |
| 32 | + uptimeChecks: {enabled: false}, |
| 33 | + attachments: {enabled: false}, |
| 34 | + userFeedback: {enabled: false}, |
| 35 | + replays: {enabled: true}, |
| 36 | + tagsTab: {enabled: true}, |
| 37 | + }, |
| 38 | + autofix: false, |
| 39 | + mergedIssues: {enabled: false}, |
| 40 | + similarIssues: {enabled: false}, |
| 41 | + stacktrace: {enabled: false}, |
| 42 | + spanEvidence: {enabled: true}, |
| 43 | + // Performance issues render a custom SpanEvidence component |
| 44 | + evidence: null, |
| 45 | + usesIssuePlatform: true, |
| 46 | + issueSummary: {enabled: false}, |
| 47 | + }, |
| 48 | + [IssueType.PERFORMANCE_CONSECUTIVE_DB_QUERIES]: { |
| 49 | + resources: { |
| 50 | + description: t( |
| 51 | + 'Consecutive DB Queries are a sequence of database spans where one or more have been identified as parallelizable, or in other words, spans that may be shifted to the start of the sequence. This often occurs when a db query performs no filtering on the data, for example a query without a WHERE clause. To learn more about how to fix consecutive DB queries, check out these resources:' |
| 52 | + ), |
| 53 | + links: [ |
| 54 | + { |
| 55 | + text: t('Sentry Docs: Consecutive DB Queries'), |
| 56 | + link: 'https://docs.sentry.io/product/issues/issue-details/performance-issues/consecutive-db-queries/', |
| 57 | + }, |
| 58 | + ], |
| 59 | + linksByPlatform: {}, |
| 60 | + }, |
| 61 | + }, |
| 62 | + [IssueType.PERFORMANCE_CONSECUTIVE_HTTP]: { |
| 63 | + resources: { |
| 64 | + description: t( |
| 65 | + 'A Consecutive HTTP issue occurs when at least 2000ms of time can be saved by parallelizing at least 3 consecutive HTTP calls occur sequentially.' |
| 66 | + ), |
| 67 | + links: [ |
| 68 | + { |
| 69 | + text: t('Sentry Docs: Consecutive HTTP'), |
| 70 | + link: 'https://docs.sentry.io/product/issues/issue-details/performance-issues/consecutive-http/', |
| 71 | + }, |
| 72 | + ], |
| 73 | + linksByPlatform: {}, |
| 74 | + }, |
| 75 | + }, |
| 76 | + [IssueType.PERFORMANCE_N_PLUS_ONE_API_CALLS]: { |
| 77 | + resources: { |
| 78 | + description: t( |
| 79 | + 'N+1 API Calls are repeated concurrent calls to fetch a resource. These spans will always begin at the same time and may potentially be combined to fetch everything at once to reduce server load. Alternatively, you may be able to lazily load the resources. To learn more about how and when to fix N+1 API Calls, check out these resources:' |
| 80 | + ), |
| 81 | + links: [ |
| 82 | + { |
| 83 | + text: t('Sentry Docs: N+1 API Calls'), |
| 84 | + link: 'https://docs.sentry.io/product/issues/issue-details/performance-issues/n-one-api-calls/', |
| 85 | + }, |
| 86 | + ], |
| 87 | + linksByPlatform: {}, |
| 88 | + }, |
| 89 | + }, |
| 90 | + [IssueType.PERFORMANCE_N_PLUS_ONE_DB_QUERIES]: { |
| 91 | + resources: { |
| 92 | + description: t( |
| 93 | + "N+1 queries are extraneous queries (N) caused by a single, initial query (+1). In the Span Evidence section, we've identified the parent span where the extraneous spans are located and the extraneous spans themselves. To learn more about how to fix N+1 problems, check out these resources:" |
| 94 | + ), |
| 95 | + links: [ |
| 96 | + { |
| 97 | + text: t('Sentry Docs: N+1 Queries'), |
| 98 | + link: 'https://docs.sentry.io/product/issues/issue-details/performance-issues/n-one-queries/', |
| 99 | + }, |
| 100 | + ], |
| 101 | + linksByPlatform: { |
| 102 | + python: [ |
| 103 | + { |
| 104 | + text: t('Finding and Fixing Django N+1 Problems'), |
| 105 | + link: 'https://blog.sentry.io/2020/09/14/finding-and-fixing-django-n-1-problems', |
| 106 | + }, |
| 107 | + ], |
| 108 | + 'python-django': [ |
| 109 | + { |
| 110 | + text: t('Finding and Fixing Django N+1 Problems'), |
| 111 | + link: 'https://blog.sentry.io/2020/09/14/finding-and-fixing-django-n-1-problems', |
| 112 | + }, |
| 113 | + ], |
| 114 | + }, |
| 115 | + }, |
| 116 | + }, |
| 117 | + [IssueType.PERFORMANCE_HTTP_OVERHEAD]: { |
| 118 | + resources: { |
| 119 | + description: t( |
| 120 | + "HTTP/1.1 can cause overhead, with long request queue times in the browser due to max connection limits. In the Span Evidence section, we've identified the extent of the wait time and spans affected by request queueing. To learn more about how to fix HTTP Overhead, check out these resources:" |
| 121 | + ), |
| 122 | + links: [ |
| 123 | + { |
| 124 | + text: t('Sentry Docs: HTTP/1.1 Overhead'), |
| 125 | + link: 'https://docs.sentry.io/product/issues/issue-details/performance-issues/http-overhead/', |
| 126 | + }, |
| 127 | + ], |
| 128 | + linksByPlatform: {}, |
| 129 | + }, |
| 130 | + }, |
| 131 | + [IssueType.PERFORMANCE_RENDER_BLOCKING_ASSET]: { |
| 132 | + resources: { |
| 133 | + description: t( |
| 134 | + 'Large render blocking assets are a type of resource span delaying First Contentful Paint (FCP). Delaying FCP means it takes more time to initially load the page for the user. Spans that end after FCP are not as critical as those that end before it. The resource span may take form of a script, stylesheet, image, or other asset that requires optimization. To learn more about how to fix large render blocking assets, check out these resources:' |
| 135 | + ), |
| 136 | + links: [ |
| 137 | + { |
| 138 | + text: t('Web Vital: First Contentful Paint'), |
| 139 | + link: 'https://web.dev/fcp/', |
| 140 | + }, |
| 141 | + ], |
| 142 | + linksByPlatform: {}, |
| 143 | + }, |
| 144 | + }, |
| 145 | + [IssueType.PERFORMANCE_SLOW_DB_QUERY]: { |
| 146 | + resources: { |
| 147 | + description: t( |
| 148 | + 'Slow DB Queries are SELECT query spans that are consistently taking longer than 500ms. A quick method to understand why this may be the case is running an EXPLAIN command on the query itself. To learn more about how to fix slow DB queries, check out these resources:' |
| 149 | + ), |
| 150 | + links: [ |
| 151 | + { |
| 152 | + text: t('Sentry Docs: Slow DB Queries'), |
| 153 | + link: 'https://docs.sentry.io/product/issues/issue-details/performance-issues/slow-db-queries/', |
| 154 | + }, |
| 155 | + ], |
| 156 | + linksByPlatform: {}, |
| 157 | + }, |
| 158 | + }, |
| 159 | + [IssueType.PERFORMANCE_LARGE_HTTP_PAYLOAD]: { |
| 160 | + resources: { |
| 161 | + description: t( |
| 162 | + 'A Large HTTP Payload issue occurs when an http payload size consistently exceeds a threshold of 300KB' |
| 163 | + ), |
| 164 | + links: [ |
| 165 | + { |
| 166 | + text: t('Sentry Docs: Large HTTP Payload'), |
| 167 | + link: 'https://docs.sentry.io/product/issues/issue-details/performance-issues/large-http-payload/', |
| 168 | + }, |
| 169 | + ], |
| 170 | + linksByPlatform: {}, |
| 171 | + }, |
| 172 | + }, |
| 173 | + [IssueType.PERFORMANCE_UNCOMPRESSED_ASSET]: { |
| 174 | + resources: { |
| 175 | + description: t( |
| 176 | + 'Uncompressed assets are asset spans that take over 300ms and are larger than 512kB which can usually be made faster with compression. Check that your server or CDN serving your assets is accepting the content encoding header from the browser and is returning them compressed.' |
| 177 | + ), |
| 178 | + links: [], |
| 179 | + linksByPlatform: {}, |
| 180 | + }, |
| 181 | + }, |
| 182 | +}; |
| 183 | + |
| 184 | +export default performanceBestPracticeConfig; |
0 commit comments