@sentry/astro 11.17+: `web-vitals` is bundled into the client even with `bundleSizeOptimizations.excludeTracing: true` (+6.4 KB gzip per page)
Les mainteneurs répondent en général sous 1 jour
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Accessibilité débutants
- 57/100
- Type d'issue
- Bug
- Clarté
- Clairement spécifiée
- Activité
- Active
- Stack technique
- javascript, node.js, typescript, vite
- Domaine
- frontend, performance
Piste de recherche
Start by tracing how bundleSizeOptimizations.excludeTracing is applied in the Astro SDK and how @sentry/browser-utils brings in build/esm/instrumentation/performanceObserver.js. Compare client bundles from 11.14.0 and 11.18.0 with tracing excluded; check whether web-vitals is still included. Done means the instrumentation and dependency are removed from the client bundle under that setting.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
Is there an existing issue for this?
I searched the open and closed issues for excludeTracing and web-vitals and found none.
Which SDK are you using?
@sentry/astro 11.18.0 (last good: 11.14.0; 11.15.0 and 11.16.0 could not be measured because of #26724)
Environment
astro7.4.13,@astrojs/cloudflare14.4.9,vite8.3.8 (rolldown), Node 26.13.1- Client SDK only, error capture only, no tracing
Setup
// astro.config.mjs
sentry({
enabled: { client: true, server: false },
bundleSizeOptimizations: { excludeTracing: true },
org: '...',
project: '...',
authToken: process.env.SENTRY_AUTH_TOKEN,
}),
// sentry.client.config.ts
import { init } from '@sentry/astro';
init({
dsn: '...',
attachStacktrace: false,
environment: 'production',
// no tracesSampleRate, no integrations
});
What happens
With bundleSizeOptimizations.excludeTracing: true and no tracing configured, the client bundle built with 11.18.0 contains the web-vitals package (pulled in by @sentry/browser-utils, build/esm/instrumentation/performanceObserver.js). With 11.14.0 no web-vitals code was in the client bundle. Same application commit, same lockfile otherwise, clean npm ci for both builds.
The two client chunks that carry the SDK, loaded on every page:
| Chunk | 11.14.0 raw | 11.18.0 raw | 11.14.0 gzip | 11.18.0 gzip |
|---|---|---|---|---|
page.*.js |
58,370 | 68,468 | 21,141 | 24,422 |
exports.*.js |
34,861 | 44,318 | 12,357 | 15,456 |
| Both | 93,231 | 112,786 | 33,498 | 39,878 |
That is about +6.4 KB gzip (+19%) on every page for a site that only captures errors. The strings resource_load_delay and element_render_delay (the LCP subparts added by #25914 in 11.17.0) appear in the exports chunk, so the web-vitals instrumentation survives tree-shaking even though tracing is excluded.
Expected
With excludeTracing: true, the web-vitals instrumentation and the web-vitals dependency are dropped from the client bundle, as the vendored web-vitals code was before 11.17.0.
A second observation, possibly intended
A local build without SENTRY_AUTH_TOKEN on 11.18.0 leaves 50 .map files in dist/server (server output grows from 6.9 MB to 13.8 MB); the same build on 11.14.0 left none. No .map files are in dist/client in either build. In @sentry/astro's integration the default for deleting maps after upload is now skipped when the build writes a Cloudflare Worker (!buildState.writesCloudflareWorker). If that is by design, a note in the changelog or docs on whether those server maps are expected to remain in the deploy directory would help.
- Langage dominant
- TypeScript
- Étoiles
- 8.8k
- Forks
- 1.9k
- Merge moyen
- 1 j 8 h
- PR mergées (30 j)
- 744
Préparer son environnement
- Aucun Dockerfile ni fichier Docker Compose
- Propose un modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de getsentry/sentry-javascript
-
AWS Lambda Waiting for: Product Owner
Difficulté 1/5 Moins d'une heure Accessibilité débutants 82/100
getsentry/sentry-javascript#26910 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
Only create Nuxt database and storage spans when there is a parent spanPeut-être à nouveau libre Une pull request pour cette issue a été fermée sans être fusionnée. OuverteImprovement Nuxt
Difficulté 2/5 1-3 heures Accessibilité débutants 83/100
getsentry/sentry-javascript#25805 · 3 commentaires ·
Les mainteneurs répondent en général sous 1 jour
-
Only create Cloudflare storage and D1 db spans when there is a parent spanPeut-être à nouveau libre Une pull request pour cette issue a été fermée sans être fusionnée. OuverteCloudflare Workers Improvement Spans
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
getsentry/sentry-javascript#25804 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
Core Feature: Typescript Meta: Breaking
Difficulté 2/5 1-3 heures Accessibilité débutants 65/100
getsentry/sentry-javascript#25286 · 2 commentaires ·
Les mainteneurs répondent en général sous 1 jour
-
javascript
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
getsentry/sentry-javascript#24200 · 2 commentaires ·
Les mainteneurs répondent en général sous 1 jour
Toutes les issues de getsentry/sentry-javascript
Issues similaires
-
Postgres upgrade golden leaves fixture URL query parameters in the expected output comparisonOuverte
Difficulté 2/5 1-3 heures Accessibilité débutants 82/100
garrytan/gbrain#10437 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
Bedrock "Too many tokens" throttle is not auto-retried, unlike "Too many requests"Peut-être pris @acmerfight l’a pris aujourd’hui. Ouverteuntriaged
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
earendil-works/pi#12573 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 70/100
agentes-chat/agentes-chat#1506 ·
Les mainteneurs répondent en général sous 1 jour
-
comp/desktop desktop/files os/windows P2 type/perf
Difficulté 2/5 1-3 heures Accessibilité débutants 80/100
NousResearch/hermes-agent#160359 ·
Les mainteneurs répondent en général sous 1 jour
-
Missing repro Platform: Android
Difficulté 2/5 1-3 heures Accessibilité débutants 76/100
software-mansion/react-native-reanimated#11554 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour