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

Stop vendoring web vitals library #11186

Open
AbhiPrasad opened this issue Mar 18, 2024 · 1 comment
Open

Stop vendoring web vitals library #11186

AbhiPrasad opened this issue Mar 18, 2024 · 1 comment
Labels
Feature: Spans Package: browser Issues related to the Sentry Browser SDK

Comments

@AbhiPrasad
Copy link
Member

When we first introduced frontend performance monitoring to the SDK we made the decision to vendor in web vitals library: https://github.com/GoogleChrome/web-vitals/.

https://github.com/getsentry/sentry-javascript/blob/a99f26051550c727a6dd94a479f4457fb15e10f3/packages/tracing-internal/src/browser/web-vitals/README.md

This was for a couple of reasons:

  1. Dependencies have a cost and we wanted to avoid introducing that to the SDK
  2. We didn't support some features like BFCache and multiple reports
  3. We didn't need all the metrics instrumentation exposed by that library

Today this looks very different. With #11185 we basically rely on every single metric that the library exposes, and with sentry metrics we can potentially flush these metrics outside of a transaction (so BFCache support and multiple reports get vastly more useful).

Today we frequently fall behind on updating our vendored fork, which means our users don't get bug fixes or improvements in a timely manner.

It's also costing us to vendor this in - we maintain a slightly different implementation which means touching this code gets very complicated, very quickly. it also means adding support for things like attributions is very difficult.

I propose we stop vendoring web vitals entirely, and just rely on it as an npm dependency OR change the nature of the fork to mean we maintain @sentry-internal/web-vitals. Given there are no notable changes that we need to make to the vendored lib, I think the first option is the best, but open for discussion.

@AbhiPrasad AbhiPrasad added Feature: Spans Package: browser Issues related to the Sentry Browser SDK labels Mar 18, 2024
@AbhiPrasad
Copy link
Member Author

The decision we make on this slightly blocks #9885

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature: Spans Package: browser Issues related to the Sentry Browser SDK
Projects
None yet
Development

No branches or pull requests

1 participant