feat(attributes): Add LCP and CLS web vital report event attribute#319
feat(attributes): Add LCP and CLS web vital report event attribute#319
Conversation
Semver Impact of This PR🟡 Minor (new features) 📋 Changelog PreviewThis is how your changes will appear in the changelog. New Features ✨Attributes
Other
Bug Fixes 🐛
Documentation 📚
Internal Changes 🔧Deps
Deps Dev
Other
Other
🤖 This preview updates automatically when you update the PR. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix prepared a fix for the issue found in the latest run.
- ✅ Fixed: Generated files edited without source model JSON files
- Created the missing source JSON files browser__web_vital__cls__report_event.json and browser__web_vital__lcp__report_event.json in model/attributes/browser/ with proper metadata and PR reference 319.
Or push these changes by commenting:
@cursor push c0d4f4cf46
Preview (c0d4f4cf46)
diff --git a/model/attributes/browser/browser__web_vital__cls__report_event.json b/model/attributes/browser/browser__web_vital__cls__report_event.json
new file mode 100644
--- /dev/null
+++ b/model/attributes/browser/browser__web_vital__cls__report_event.json
@@ -1,0 +1,18 @@
+{
+ "key": "browser.web_vital.cls.report_event",
+ "brief": "The event that caused the SDK to report CLS (pagehide or navigation)",
+ "type": "string",
+ "pii": {
+ "key": "maybe"
+ },
+ "is_in_otel": false,
+ "example": "navigation",
+ "sdks": ["javascript-browser"],
+ "changelog": [
+ {
+ "version": "next",
+ "prs": [319],
+ "description": "Added browser.web_vital.cls.report_event attribute"
+ }
+ ]
+}
diff --git a/model/attributes/browser/browser__web_vital__lcp__report_event.json b/model/attributes/browser/browser__web_vital__lcp__report_event.json
new file mode 100644
--- /dev/null
+++ b/model/attributes/browser/browser__web_vital__lcp__report_event.json
@@ -1,0 +1,18 @@
+{
+ "key": "browser.web_vital.lcp.report_event",
+ "brief": "The event that caused the SDK to report LCP (pagehide or navigation)",
+ "type": "string",
+ "pii": {
+ "key": "maybe"
+ },
+ "is_in_otel": false,
+ "example": "pagehide",
+ "sdks": ["javascript-browser"],
+ "changelog": [
+ {
+ "version": "next",
+ "prs": [319],
+ "description": "Added browser.web_vital.lcp.report_event attribute"
+ }
+ ]
+}This Bugbot Autofix run was free. To enable autofix for future PRs, go to the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 2404d54. Configure here.
| "deprecation": { | ||
| "replacement": null, | ||
| "reason": "The report event is now recorded as a browser.web_vital.lcp.report_event or browser.web_vital.cls.report_event attribute. No backfill required.", | ||
| "_status": null | ||
| }, |
There was a problem hiding this comment.
I documented the old attribute (currently still sent with v1 standalone web vital spans) and marked it as deprecated. Since there's no 1:1 replacement but SDKs send one of two different attributes depending on the span, I left repalcement and _status intentionally on null since I don't think we can backfill this at all. Given there's no product logic around these attributes I think that's fine but happy to do something else if reviewers have concerns.


Two web vital attributes were missing which we should still include for web vital meta information:
browser.web_vital.lcp.report_eventbrowser.web_vital.cls.report_eventThese attributes carry information on what event caused the SDK to report a web vital span for CLS and LCP: Either a
pagehideornavigationevent. More events could follow in the future.For both of these web vitals, we previously sent
sentry.report_eventbut in retrospect I believe this was a bad naming choice (my fault lol). Given we have a common pattern now for web vitals, let's align these. No product logic depends on these attributes. They're merely meta information.ref: