-
Notifications
You must be signed in to change notification settings - Fork 5
feat: Add sentry to bundler plugins #72
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
Closed
Closed
Changes from all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
4822616
create sentry util for tracking traces, issues, and metrics
nsdeschenes e6c5c29
add sentry node
nsdeschenes b9f202c
setup unbuild to inline replace __PACKAGE_VERSION with the current re…
nsdeschenes 1f7d135
add telemetry option to the plugin config
nsdeschenes b963fbe
configure sentry client to be used across bundler plugins
nsdeschenes 7ce2799
add guage metric to fetchWithRetry function
nsdeschenes 62cab8f
pass through sentry client in getPreSignedURL and uploadStats
nsdeschenes f3ad016
add bundler plugin metrics to plugin factory
nsdeschenes e4ae897
use new normalizeOptions function and create sentry client if conditi…
nsdeschenes 22e2fe1
add in changeset
nsdeschenes 8167a07
swap to using gauge factory function for fetchWithRetry, and add tags…
nsdeschenes 84ebd39
fix up a few things with sentry setup
nsdeschenes 9486589
fix up bundle analysis type error in test
nsdeschenes 6ca1025
rework how sentry metrics are collected
nsdeschenes a50562f
fix type error
nsdeschenes ab9d98d
disable telemetry in integration tests
nsdeschenes f042bc9
checking sentrt debug logs
nsdeschenes f97223d
create telem plugin
nsdeschenes 22afbd4
use telem plugin
nsdeschenes 49d8b7a
inline replace in all plugin build configs
nsdeschenes 1c997de
maybe we just need to reassign the options?
nsdeschenes 90582e6
that didn't work
nsdeschenes 6799747
small tweaks post rebase
nsdeschenes 9b08536
small fix for telemetry type issue
nsdeschenes File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
"@codecov/bundler-plugin-core": patch | ||
"@codecov/rollup-plugin": patch | ||
"@codecov/vite-plugin": patch | ||
"@codecov/webpack-plugin": patch | ||
--- | ||
|
||
Add Sentry in to collect traces and metrics" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { type Hub, type NodeClient } from "@sentry/node"; | ||
import { type UnpluginOptions } from "unplugin"; | ||
import { dim } from "../utils/logging"; | ||
import { safeFlushTelemetry } from "../sentry"; | ||
|
||
interface TelemetryPluginOptions { | ||
sentryHub?: Hub; | ||
sentryClient?: NodeClient; | ||
shouldSendTelemetry: boolean; | ||
} | ||
|
||
export function telemetryPlugin({ | ||
sentryHub, | ||
sentryClient, | ||
shouldSendTelemetry, | ||
}: TelemetryPluginOptions): UnpluginOptions { | ||
return { | ||
name: "codecov-telemetry-plugin", | ||
async buildStart() { | ||
if (shouldSendTelemetry && sentryHub && sentryClient) { | ||
dim( | ||
"Sending error and performance telemetry data to Sentry. To disable telemetry, set `options.telemetry` to `false`.", | ||
); | ||
sentryHub | ||
.startTransaction({ name: "Codecov Bundler Plugin execution" }) | ||
.finish(); | ||
await safeFlushTelemetry(sentryClient); | ||
} | ||
}, | ||
}; | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.