Skip to content

Commit

Permalink
refactor: remove Sentry util (#489)
Browse files Browse the repository at this point in the history
relates-to: #458
  • Loading branch information
lsndr committed Oct 26, 2023
1 parent 0ac6eb5 commit d10eb94
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
9 changes: 5 additions & 4 deletions src/Config/CliBuilder.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { CliConfig, ConfigReader } from './ConfigReader';
import { ClusterArgs, Helpers, logger, LogLevel, Sentry } from '../Utils';
import { ClusterArgs, Helpers, logger, LogLevel } from '../Utils';
import { SystemConfigManager } from './SystemConfigManager';
import { CliInfo } from './CliInfo';
import { Arguments, Argv, CommandModule } from 'yargs';
import { init, runWithAsyncContext, setContext } from '@sentry/node';

export interface CliBuilderOptions {
info: CliInfo;
Expand Down Expand Up @@ -108,9 +109,9 @@ export class CliBuilder {
const systemConfigManager = new SystemConfigManager(args.api as string);
const systemConfig = await systemConfigManager.read();

return Sentry.runWithAsyncContext(() => {
return runWithAsyncContext(() => {
this.initSentry(systemConfig.sentryDsn);
Sentry.setContext('args', args);
setContext('args', args);

systemConfigManager.enableBackgroundRotation((rotatedSystemConfig) => {
this.initSentry(rotatedSystemConfig.sentryDsn);
Expand All @@ -124,7 +125,7 @@ export class CliBuilder {
}

private initSentry(dsn: string) {
Sentry.init({
init({
attachStacktrace: true,
dsn,
release: process.env.VERSION,
Expand Down
3 changes: 0 additions & 3 deletions src/Utils/Sentry.ts

This file was deleted.

1 change: 0 additions & 1 deletion src/Utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,3 @@ export * from './Helpers';
export * from './Logger';
export * from './Backoff';
export * from './Traceroute';
export { default as Sentry } from './Sentry';

0 comments on commit d10eb94

Please sign in to comment.