-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
feat: Add serializeAttribute option to breadcrumbs / dom.
#3620
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
Conversation
size-limit report
|
3ea684b to
9519a4d
Compare
9519a4d to
9deeb18
Compare
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.
Solid 🥇
Let's not forget to update docs to add this new option.
|
@onurtemizkan before we merge, can we make sure we go through all linked comments/issues of the referenced Issues to make sure we don't miss something. |
|
@HazAT, there are also requests to be able to add extra attributes to |
serializeAttribute option to breadcrumbs / dom.serializeAttribute option to breadcrumbs / dom.
|
Would anyone be open to the possibility of For example, {
serializeAttribute: [
'data-testid', // all our good devs using react-testing library
'aria-label', // attempt to fallback on something recognizable
],
}
...then something like, const keyAttrValue = Array.isArray(keyAttr) && keyAttr.length
? elem.getAttribute(keyAttr.find(attr => elem.hasAttribute(attr)))
: null; |
|
I think we could make it work. Could you please open a new issue referencing this one? Thanks |
I cannot find any docs on this option. How/where do I set it? Is it done via |
|
https://docs.sentry.io/platforms/javascript/configuration/integrations/breadcrumbs/#dom Sentry.init({
dsn: "https://[email protected]/0",
integrations: [
Sentry.breadcrumbsIntegration({
dom: {
serializeAttribute: ['your', 'list', 'goes', 'here']
}
})
]
}) |
Thanks very much, not sure why I couldn't find that, maybe I had a |
Resolves: #3604
Added
serializeAttributeoption toBreadcrumbs/domintegration, to allow users to define an element attribute to be serialized in breadcrumbs instead ofids orclassnames.