Created
October 24, 2018 15:50
-
-
Save kasunkv/e8735976fbcdb18806150cbaec47f208 to your computer and use it in GitHub Desktop.
Monitoring Class encapsulating 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
import * as sentry from '@sentry/node'; | |
import { IMonitoring } from './interfaces/IMonitoring'; | |
import { SentryEvent } from '@sentry/node'; | |
export class Monitoring implements IMonitoring { | |
constructor() { | |
} | |
configure(): void { | |
sentry.init({ | |
dsn: 'SENTRY_DSN', | |
release: 'TASK_RELEASE_VERSION' | |
}); | |
} | |
captureException(error: any): void { | |
sentry.captureException(error); | |
} | |
captureEvent(event: SentryEvent): void { | |
sentry.captureEvent(event); | |
} | |
captureMessage(message: string): void { | |
sentry.captureMessage(message); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment