-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #53 from codecov/spalmurray/sentry
feat: Add Sentry error monitoring
- Loading branch information
Showing
8 changed files
with
1,733 additions
and
355 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains 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 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 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 |
---|---|---|
@@ -1,8 +1,14 @@ | ||
import { ExtensionContext } from "vscode"; | ||
import { activateCoverage } from "./coverage/coverage"; | ||
import { activateYAML } from "./yaml/yamlClientMain"; | ||
import Sentry from "./sentry"; | ||
|
||
export function activate(context: ExtensionContext) { | ||
activateCoverage(context); | ||
return activateYAML(context); | ||
try { | ||
activateCoverage(context); | ||
return activateYAML(context); | ||
} catch (e) { | ||
Sentry.captureException(e); | ||
throw e; | ||
} | ||
} |
This file contains 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,38 @@ | ||
import { | ||
BrowserClient, | ||
defaultStackParser, | ||
getDefaultIntegrations, | ||
makeFetchTransport, | ||
Scope, | ||
} from "@sentry/browser"; | ||
|
||
// Sentry config | ||
// Browser extensions (and vscode extensions!) must initialize Sentry a bit | ||
// differently to avoid conflicts between Sentry instances should the site the | ||
// extension is running on also use Sentry. Read more here: | ||
// https://docs.sentry.io/platforms/javascript/best-practices/browser-extensions/ | ||
|
||
const sentryIntegrations = getDefaultIntegrations({}).filter( | ||
(defaultIntegration) => { | ||
return ![ | ||
"BrowserApiErrors", | ||
"TryCatch", | ||
"Breadcrumbs", | ||
"GlobalHandlers", | ||
].includes(defaultIntegration.name); | ||
} | ||
); | ||
|
||
const sentryClient = new BrowserClient({ | ||
// @ts-ignore SENTRY_DSN is populated by Webpack at build time | ||
dsn: SENTRY_DSN, | ||
transport: makeFetchTransport, | ||
stackParser: defaultStackParser, | ||
integrations: sentryIntegrations, | ||
}); | ||
|
||
const Sentry = new Scope(); | ||
Sentry.setClient(sentryClient); | ||
sentryClient.init(); | ||
|
||
export default Sentry; |
This file contains 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 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 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