@comfortable-typescript/nestjs-sentry v1.0.3
@comfortable-typescript/nestjs-sentry
Introduction
This module allows to use the following features of the sentry. 1. Error issues reporting 2. Performance 3. Profiling
Installation
npm install --save-dev @comfortable-typescript/nestjs-sentryUsage
Include SentryModule
import { SentryModule } from '@comfortable-typescript/nestjs-sentry';
@Module({
imports: [
SentryModule.forRoot({
// @see https://docs.sentry.io/platforms/node/configuration/options
dsn: 'https://dsn.sentry.io',
tracesSampleRate: 1,
}),
RootModule,
ConsumerModule,
],
controllers: [],
providers: [],
})
export class AppModule {}Tracing
- Include SentrycingModule
import { EnSentryTracingName, SentryTracingModule } from '@comfortable-typescript/nestjs-sentry';
@Module({
imports: [
// register input: HTTP_INTERNAL | DATABASE | REDIS | KAFKA | CUSTOM
SentryTracingModule.register(EnSentryOperationName.INTERNAL_HTTP),
]
})
export class SomeModule {}- Start and finish wherever you want.
import { request } from 'undici';
import { SentryTracingService } from '@comfortable-typescript/nestjs-sentry';
export class SomService {
import
@Inject(SentryTracingService) private readonly sentryTracingService: SentryTracingSerice;
public async test() {
// startTracing optional input: HTTP_INTERNAL | DATABASE | REDIS | KAFKA | CUSTOM
const span = this.sentryTracingService.startTracing();
// http request through modules such as undici, axios
const response = await request('http://localhost:3000/test');
span.finishTracing();
return response;
}
}6 months ago
6 months ago
7 months ago
1 year ago
12 months ago
12 months ago
11 months ago
11 months ago
6 months ago
8 months ago
7 months ago
11 months ago
10 months ago
9 months ago
9 months ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago