Skip to content
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

Add SvelteKit component tracking auto instrumentation #11808

Open
Lms24 opened this issue Apr 26, 2024 · 0 comments
Open

Add SvelteKit component tracking auto instrumentation #11808

Lms24 opened this issue Apr 26, 2024 · 0 comments

Comments

@Lms24
Copy link
Member

Lms24 commented Apr 26, 2024

Problem Statement

Right now, as described in #11807, component tracking in SvelteKit apps is a bit tricky and doesn't work in the same way as for pure svelte apps. We should change this and make it as DX-friendly as possible. Ideally, users don't have to touch another file (i.e. svelte.config.js) to get automatic component tracking.

Solution Brainstorm

My current idea is to add the trackComponent function call to *.svelte files in a vite plugin, just like we modify +page.js files for load function auto instrumentation. We'd just return another vite plugin from the sentrySveltekit plugin factory functions which users already register in their vite.config.js.

This should work nicely but we need to keep an eye on the usual suspects:

  • source maps integrity
  • svelteHTML parsing / ensuring we inject the call in the right places
  • extracing correct and useful component names
  • Default behaviour: Track all pages by default? Also all components? Who knows...
  • Ensure this only runs client-side during/after hydration
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant