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

feat: Add sentry to bundler plugins #72

Open
wants to merge 24 commits into
base: main
Choose a base branch
from

Conversation

nicholas-codecov
Copy link
Collaborator

Description

This PR adds in Sentry to collect traces and metics for the bundler plugins

Closes codecov/engineering-team#954

Notable Changes

  • Add Sentry Node
  • Configure Sentry traces
  • Configure some Sentry metrics

Copy link

@codecov codecov bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes in the 'bundler-plugin-core' package look good overall. It incorporates Sentry integration for collecting traces and metrics, and this has been done consistently and systematically across the application's core functions. Moreover, it introduces neatly encapsulated utility functions for Sentry client generation, options normalization, and Sentry-enabled fetch retries. A critical thing to note, however, is the magic string Sentry DSN within the createSentryInstance function. This could benefit from refactoring to isolate it as a constant or config file variable to avoid potential security risks and code readability.

Copy link

codecov bot commented Feb 13, 2024

Codecov Report

Attention: Patch coverage is 9.73451% with 102 lines in your changes are missing coverage. Please review.

Project coverage is 77.07%. Comparing base (17773f5) to head (9b08536).
Report is 1 commits behind head on main.

Files Patch % Lines
packages/bundler-plugin-core/src/sentry.ts 0.00% 49 Missing and 3 partials ⚠️
packages/bundler-plugin-core/src/index.ts 0.00% 22 Missing and 4 partials ⚠️
...src/bundle-analysis/bundleAnalysisPluginFactory.ts 14.28% 12 Missing ⚠️
...kages/bundler-plugin-core/src/plugins/telemetry.ts 0.00% 7 Missing ⚠️
...es/bundler-plugin-core/src/utils/fetchWithRetry.ts 58.33% 5 Missing ⚠️
Additional details and impacted files
Components Coverage Δ
Plugin core 87.30% <9.73%> (-6.93%) ⬇️
Rollup plugin 7.24% <ø> (ø)
Vite plugin 7.24% <ø> (ø)
Webpack plugin 32.63% <ø> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@AbhiPrasad AbhiPrasad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Just a comment about the metrics API, but otherwise looks solid. Thanks for taking a look at this!

@codecov-staging
Copy link

codecov-staging bot commented Feb 16, 2024

Codecov Report

Attention: Patch coverage is 9.73451% with 102 lines in your changes are missing coverage. Please review.

Files Patch % Lines
packages/bundler-plugin-core/src/sentry.ts 0.00% 52 Missing ⚠️
packages/bundler-plugin-core/src/index.ts 0.00% 22 Missing and 4 partials ⚠️
...src/bundle-analysis/bundleAnalysisPluginFactory.ts 14.28% 12 Missing ⚠️
...kages/bundler-plugin-core/src/plugins/telemetry.ts 0.00% 7 Missing ⚠️
...es/bundler-plugin-core/src/utils/fetchWithRetry.ts 58.33% 5 Missing ⚠️
Components Coverage Δ
Plugin core 87.30% <9.73%> (?)
Rollup plugin 7.24% <ø> (?)
Vite plugin 7.24% <ø> (?)
Webpack plugin 32.63% <ø> (?)

📢 Thoughts on this report? Let us know!

@nicholas-codecov nicholas-codecov force-pushed the gh-eng-954-add-sentry-to-bunlder-plugins branch from 48e19a8 to d513ce1 Compare February 20, 2024 18:25
Copy link

codecov bot commented Feb 20, 2024

Bundle Report

Changes will increase total bundle size by 5.43kB ⬆️

Bundle name Size Change
@codecov/example-vite-app-es 150.59kB 0 bytes
@codecov/rollup-plugin-es 152 bytes 0 bytes
@codecov/vite-plugin-cjs 10.83kB 0 bytes
@codecov/bundler-plugin-core-cjs 176.93kB 16.84kB ⬆️
@codecov/bundler-plugin-core-es 8.17kB 760 bytes ⬆️
@codecov/example-next-app-client 894.27kB 0 bytes
@codecov/example-rollup-app-iife 256.9kB 0 bytes
@codecov/rollup-plugin-cjs 10.7kB 0 bytes
@codecov/webpack-plugin-cjs 12.74kB 0 bytes
@codecov/webpack-plugin-es 154 bytes 12.17kB ⬇️
@codecov/example-next-app-server 325.59kB 0 bytes
@codecov/example-next-app-edge-server 306 bytes 0 bytes
@codecov/example-webpack-app-array-push 71.19kB 0 bytes
@codecov/vite-plugin-es 271 bytes 0 bytes

@nicholas-codecov nicholas-codecov force-pushed the gh-eng-954-add-sentry-to-bunlder-plugins branch from 5720f96 to ddb2c1d Compare February 23, 2024 22:24
@nicholas-codecov nicholas-codecov force-pushed the gh-eng-954-add-sentry-to-bunlder-plugins branch from 8564ffb to 6799747 Compare March 5, 2024 15:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bundler Plugins] Add Sentry to bundler core for errors, traces and ddm
2 participants