Skip to content

Vue trackComponents allowlist should match for components without <> #13510

Closed
@Lms24

Description

@Lms24

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/vue

SDK Version

8.26.0

Framework Version

Vue 3, possibly Vue 2

Link to Sentry event

No response

Reproduction Example/SDK Setup

Configure component tracking in the Vue SDK with an allowlist which components should be tracked like so

Sentry.init({
  //...
  trackComponents: [
    "App",
    "RwvHeader",
    "RwvFooter",
    "RwvArticleList",
    "Pagination",
  ],
})

Steps to Reproduce

Configure SDK as shown above

Expected Result

Only the components mentioned in trackComponents will get component lifecycle spans

Actual Result

As reported in #13484, no spans at all are recorded because the list doesn't match any of the internally formatted component names. Instead, what users would need to enter is:

Sentry.init({
  //...
  trackComponents: [
    "<App>",
    "<RwvHeader>",
    "<RwvFooter>",
    "<RwvArticleList>",
    "<Pagination>",
  ],
})

which is very unintuitive.

To solve this, we should match for both, the component name with and without angle brackets. We should continue to match with <> to not break existing setups where users figured this out already.

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions