-
Notifications
You must be signed in to change notification settings - Fork 571
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 #7359 from ever-co/develop
feat: better handing of Sentry / Unhandled exceptions / Redis connect…
- Loading branch information
Showing
5 changed files
with
91 additions
and
63 deletions.
There are no files selected for viewing
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
59 changes: 30 additions & 29 deletions
59
packages/core/src/core/sentry/ntegral/sentry.interfaces.ts
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,52 +1,53 @@ | ||
import { ModuleMetadata, Type } from "@nestjs/common/interfaces"; | ||
import { ModuleMetadata, Type } from '@nestjs/common/interfaces'; | ||
import { Integration, Options } from '@sentry/types'; | ||
import { ConsoleLoggerOptions, HttpException } from "@nestjs/common"; | ||
import { SeverityLevel } from "@sentry/node"; | ||
import { ConsoleLoggerOptions } from '@nestjs/common'; | ||
import { SeverityLevel } from '@sentry/node'; | ||
|
||
export interface SentryCloseOptions { | ||
enabled: boolean; | ||
// timeout – Maximum time in ms the client should wait until closing forcefully | ||
timeout?: number; | ||
enabled: boolean; | ||
// timeout – Maximum time in ms the client should wait until closing forcefully | ||
timeout?: number; | ||
} | ||
|
||
export type SentryModuleOptions = Omit<Options, 'integrations'> & { | ||
integrations?: Integration[]; | ||
close?: SentryCloseOptions | ||
integrations?: Integration[]; | ||
close?: SentryCloseOptions; | ||
profilesSampleRate?: number; | ||
} & ConsoleLoggerOptions; | ||
|
||
export interface SentryOptionsFactory { | ||
createSentryModuleOptions(): Promise<SentryModuleOptions> | SentryModuleOptions; | ||
createSentryModuleOptions(): Promise<SentryModuleOptions> | SentryModuleOptions; | ||
} | ||
|
||
export interface SentryModuleAsyncOptions extends Pick<ModuleMetadata, 'imports'> { | ||
inject?: any[]; | ||
useClass?: Type<SentryOptionsFactory>; | ||
useExisting?: Type<SentryOptionsFactory>; | ||
useFactory?: (...args: any[]) => Promise<SentryModuleOptions> | SentryModuleOptions; | ||
inject?: any[]; | ||
useClass?: Type<SentryOptionsFactory>; | ||
useExisting?: Type<SentryOptionsFactory>; | ||
useFactory?: (...args: any[]) => Promise<SentryModuleOptions> | SentryModuleOptions; | ||
} | ||
|
||
export type SentryTransaction = boolean | 'path' | 'methodPath' | 'handler'; | ||
|
||
export interface SentryFilterFunction { | ||
(exception:any): boolean | ||
(exception: any): boolean; | ||
} | ||
|
||
export interface SentryInterceptorOptionsFilter { | ||
type: any; | ||
filter?: SentryFilterFunction; | ||
type: any; | ||
filter?: SentryFilterFunction; | ||
} | ||
|
||
export interface SentryInterceptorOptions { | ||
filters?: SentryInterceptorOptionsFilter[]; | ||
tags?: { [key: string]: string }; | ||
extra?: { [key: string]: any }; | ||
fingerprint?: string[]; | ||
level?: SeverityLevel; | ||
|
||
// https://github.com/getsentry/sentry-javascript/blob/master/packages/node/src/handlers.ts#L163 | ||
request?: boolean; | ||
serverName?: boolean; | ||
transaction?: boolean | 'path' | 'methodPath' | 'handler'; // https://github.com/getsentry/sentry-javascript/blob/master/packages/node/src/handlers.ts#L16 | ||
user?: boolean | string[]; | ||
version?: boolean; | ||
} | ||
filters?: SentryInterceptorOptionsFilter[]; | ||
tags?: { [key: string]: string }; | ||
extra?: { [key: string]: any }; | ||
fingerprint?: string[]; | ||
level?: SeverityLevel; | ||
|
||
// https://github.com/getsentry/sentry-javascript/blob/master/packages/node/src/handlers.ts#L163 | ||
request?: boolean; | ||
serverName?: boolean; | ||
transaction?: boolean | 'path' | 'methodPath' | 'handler'; // https://github.com/getsentry/sentry-javascript/blob/master/packages/node/src/handlers.ts#L16 | ||
user?: boolean | string[]; | ||
version?: boolean; | ||
} |
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