Browse Source

feat(perf-issues): Add UI text for unc. asset detector (#43339)

Adds UI changes required to make uncompressed asset issues appear in
issue detail view.
Kev 2 years ago
parent
commit
bbd08cdbcb

+ 5 - 0
static/app/components/events/interfaces/performance/utils.tsx

@@ -32,6 +32,9 @@ const RESOURCES_DESCRIPTIONS: Record<IssueType, string> = {
   [IssueType.PERFORMANCE_SLOW_SPAN]: t(
     'Slow DB Queries are SELECT query spans that take longer than 1s. 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:'
   ),
+  [IssueType.PERFORMANCE_UNCOMPRESSED_ASSET]: t(
+    'Uncompressed assets are asset spans that take over 50ms 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.'
+  ),
   [IssueType.ERROR]: '',
 };
 
@@ -56,6 +59,7 @@ const DEFAULT_RESOURCE_LINK: Record<IssueType, ResourceLink[]> = {
       link: 'https://docs.sentry.io/product/issues/issue-details/performance-issues/n-one-api-calls/',
     },
   ],
+  [IssueType.PERFORMANCE_UNCOMPRESSED_ASSET]: [],
   [IssueType.PERFORMANCE_FILE_IO_MAIN_THREAD]: [],
   [IssueType.PERFORMANCE_SLOW_SPAN]: [],
   [IssueType.ERROR]: [],
@@ -81,6 +85,7 @@ const RESOURCE_LINKS: Record<IssueType, PlatformSpecificResources> = {
   [IssueType.PERFORMANCE_CONSECUTIVE_DB_QUERIES]: {},
   [IssueType.PERFORMANCE_FILE_IO_MAIN_THREAD]: {},
   [IssueType.PERFORMANCE_SLOW_SPAN]: {},
+  [IssueType.PERFORMANCE_UNCOMPRESSED_ASSET]: {},
   [IssueType.ERROR]: {},
 };
 

+ 1 - 0
static/app/types/group.tsx

@@ -61,6 +61,7 @@ export enum IssueType {
   PERFORMANCE_N_PLUS_ONE_API_CALLS = 'performance_n_plus_one_api_calls',
   PERFORMANCE_N_PLUS_ONE_DB_QUERIES = 'performance_n_plus_one_db_queries',
   PERFORMANCE_SLOW_SPAN = 'performance_slow_span',
+  PERFORMANCE_UNCOMPRESSED_ASSET = 'performance_uncompressed_assets',
 }
 
 type CapabilityInfo = {