-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
feat(browser): Track measure detail as span attributes #16240
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
❌ We are unable to process any of the uploaded JUnit XML files. Please ensure your files are in the right format. |
size-limit report 📦
|
attributes[`sentry.browser.measure.detail.${key}`] = value as SpanAttributeValue; | ||
} else { | ||
try { | ||
// This is user defined so we can't guarantee it's serializable |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
l: Can we instead just wrap the whole block inside of if (entry.detail)
in a try-catch, maybe slightly less redundant?
// https://developer.mozilla.org/en-US/docs/Web/API/Performance/measure#detail | ||
if (entry.detail) { | ||
// Handle detail as an object | ||
if (typeof entry.detail === 'object') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would also ask to support arrays of primitives, here and as object props 🙏
Listing some things in spans is very useful, and SpanAttributeValue
supports this.
resolves #16237
The SDK automatically instruments the
performance.measure
API, but doesn't supportdetail
, which is the way you can attach arbitrary data toperformance.measure
. Given you can seedetails
in browser dev-tools, we should probably support it in the same way in Sentry.https://developer.mozilla.org/en-US/docs/Web/API/Performance/measure
detail docs: https://developer.mozilla.org/en-US/docs/Web/API/PerformanceMeasure/detail
Detail is completely arbitrary, so we have to take care before parsing it. I have added tests accordingly.