Browse Source

feat(webvitals): Adds a description for INP (#64110)

Adds INP descriptions and constants for future use in performance.
edwardgou-sentry 1 year ago
parent
commit
5baa3a87dd

+ 6 - 0
static/app/utils/fields/index.ts

@@ -144,6 +144,7 @@ export enum WebVital {
   FID = 'measurements.fid',
   CLS = 'measurements.cls',
   TTFB = 'measurements.ttfb',
+  INP = 'measurements.inp',
   REQUEST_TIME = 'measurements.ttfb.requesttime',
 }
 
@@ -470,6 +471,11 @@ export const MEASUREMENT_FIELDS: Record<WebVital | MobileVital, FieldDefinition>
     kind: FieldKind.METRICS,
     valueType: FieldValueType.DURATION,
   },
+  [WebVital.INP]: {
+    desc: t('Web Vital Interaction to Next Paint'),
+    kind: FieldKind.METRICS,
+    valueType: FieldValueType.DURATION,
+  },
 };
 
 export const SPAN_OP_FIELDS: Record<SpanOpBreakdown, FieldDefinition> = {

+ 10 - 0
static/app/utils/performance/vitals/constants.tsx

@@ -44,6 +44,16 @@ export const WEB_VITAL_DETAILS: Record<WebVital, Vital> = {
     poorThreshold: 300,
     type: measurementType(WebVital.FID),
   },
+  [WebVital.INP]: {
+    slug: 'inp',
+    name: t('Interaction to Next Paint'),
+    acronym: 'INP',
+    description: t(
+      'The duration of the longest interaction observed, ignoring outliers.'
+    ),
+    poorThreshold: 500,
+    type: measurementType(WebVital.INP),
+  },
   [WebVital.CLS]: {
     slug: 'cls',
     name: t('Cumulative Layout Shift'),

+ 4 - 0
static/app/views/performance/browser/webVitals/components/webVitalDescription.tsx

@@ -35,6 +35,7 @@ const WEB_VITAL_FULL_NAME_MAP = {
   cls: t('Cumulative Layout Shift'),
   fcp: t('First Contentful Paint'),
   fid: t('First Input Delay'),
+  inp: t('Interaction to Next Paint'),
   lcp: t('Largest Contentful Paint'),
   ttfb: t('Time to First Byte'),
 };
@@ -55,6 +56,9 @@ const VITAL_DESCRIPTIONS: Partial<Record<WebVital, string>> = {
   [WebVital.TTFB]: t(
     'Time to First Byte (TTFB) is a foundational metric for measuring connection setup time and web server responsiveness in both the lab and the field. It helps identify when a web server is too slow to respond to requests. In the case of navigation requests—that is, requests for an HTML document—it precedes every other meaningful loading performance metric.'
   ),
+  [WebVital.INP]: t(
+    "Interaction to Next Paint (INP) is a metric that assesses a page's overall responsiveness to user interactions by observing the latency of all click, tap, and keyboard interactions that occur throughout the lifespan of a user's visit to a page. The final INP value is the longest interaction observed, ignoring outliers."
+  ),
 };
 
 type WebVitalDetailHeaderProps = {