Skip to content

Instantly share code, notes, and snippets.

@kasunkv
Created October 24, 2018 15:50
Show Gist options
  • Save kasunkv/e8735976fbcdb18806150cbaec47f208 to your computer and use it in GitHub Desktop.
Save kasunkv/e8735976fbcdb18806150cbaec47f208 to your computer and use it in GitHub Desktop.
Monitoring Class encapsulating Sentry.
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