0.1.10 • Published 8 months ago

@comfortable-typescript/nestjs-sentry v0.1.10

Weekly downloads
-
License
MIT
Repository
github
Last release
8 months 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.10

8 months ago

0.1.9

8 months ago

0.1.8

8 months ago

0.1.7

8 months ago

0.1.6

9 months ago

0.1.4

10 months ago

0.1.5

9 months ago

0.0.32

1 year ago

0.0.33

1 year ago

0.0.34

11 months ago

0.0.35

11 months ago

0.1.2

10 months ago

0.1.1

11 months ago

0.1.3

10 months ago

0.1.0

1 year ago

0.0.31

1 year ago

0.0.30

1 year ago

0.0.29

1 year ago

0.0.27

1 year ago

0.0.28

1 year ago

0.0.26

1 year ago

0.0.25

1 year ago

0.0.24

1 year ago

0.0.23

1 year ago

0.0.22

1 year ago

0.0.21

1 year ago

0.0.20

2 years ago

0.0.11

2 years ago

0.0.12

2 years ago

0.0.13

2 years ago

0.0.14

2 years ago

0.0.15

2 years ago

0.0.16

2 years ago

0.0.17

2 years ago

0.0.18

2 years ago

0.0.19

2 years ago

0.0.10

2 years ago

0.0.9

2 years ago

0.0.8

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago