0.1.0 • Published 12 hours ago

@comfortable-typescript/nestjs-sentry v0.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
12 hours ago

@comfortable-typescript/nestjs-sentry

Introduction

Sentry module for NestJS.

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-sentry

Usage

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

  1. 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 {}
  1. 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;
  }
}
0.1.0

12 hours ago

0.0.31

27 days ago

0.0.30

1 month ago

0.0.29

1 month ago

0.0.27

2 months ago

0.0.28

2 months ago

0.0.26

2 months ago

0.0.25

2 months ago

0.0.24

3 months ago

0.0.23

3 months ago

0.0.22

4 months ago

0.0.21

4 months ago

0.0.20

5 months ago

0.0.11

10 months ago

0.0.12

10 months ago

0.0.13

9 months ago

0.0.14

8 months ago

0.0.15

8 months ago

0.0.16

7 months ago

0.0.17

7 months ago

0.0.18

7 months ago

0.0.19

6 months ago

0.0.10

11 months ago

0.0.9

11 months ago

0.0.8

11 months ago

0.0.5

12 months ago

0.0.4

12 months ago

0.0.7

11 months ago

0.0.6

12 months ago

0.0.3

12 months ago

0.0.2

12 months ago

0.0.1

12 months ago