Commit 0727988
authored
ref(browser-utils): Align standalone LCP span attribute setting with pageload span LCP attributes (#16844)
Small follow-up from #16591: As identified by cursor (lol), our way of
setting the `lcp.*` attributes wasn't 100% aligned with how and when we
set these attributes on the pageload span. This PR changes two things:
- only set attributes if the respective LCP entry values are defined
- truncate `lcp.url` if it is longer than 200 characters
Also:
- re-added comments, since we'll likely remove the pageload-based logic
at some point
- also add `lcp.size` if `entry.size === 0` (which previously was falsy
and hence not added)
- added unit tests1 parent a215bf9 commit 0727988
2 files changed
+24
-9
lines changedLines changed: 0 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
63 | | - | |
64 | 63 | | |
65 | 64 | | |
66 | 65 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
47 | | - | |
| 47 | + | |
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| |||
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
91 | | - | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
92 | 99 | | |
93 | 100 | | |
94 | 101 | | |
| |||
105 | 112 | | |
106 | 113 | | |
107 | 114 | | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
114 | 130 | | |
115 | 131 | | |
116 | 132 | | |
| |||
0 commit comments