Skip to content

Commit

Permalink
misc: Rename keys leading up to LCP metric
Browse files Browse the repository at this point in the history
The idea is to align with the name used in web-vitals (LCP in uppercase,
not lcp) and to constrain the custom container in data to metrics
related to Web Vitals.

Do not double encode as JSON, assume that normalization is solved
elsewhere.
  • Loading branch information
rhcarvalho committed Jun 5, 2020
1 parent 5dc4029 commit 3c88853
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/apm/src/integrations/tracing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,7 @@ export class Tracing implements Integration {
Tracing._forceLCP();
if (Tracing._lcp) {
// Set the last observed LCP score.
transactionSpan.setData('_sentry_extra_metrics', JSON.stringify({ lcp: Tracing._lcp }));
transactionSpan.setData('_sentry_web_vitals', { LCP: Tracing._lcp });
}
}

Expand Down Expand Up @@ -685,7 +685,7 @@ export class Tracing implements Integration {
elementId: entry.id,
// @ts-ignore
elementSize: entry.size,
largestContentfulPaint: entry.startTime,
value: entry.startTime,
};
}
};
Expand Down

0 comments on commit 3c88853

Please sign in to comment.