All Projects → ntegral → Nestjs Sentry

ntegral / Nestjs Sentry

Licence: isc
Provides an injectable sentry.io client to provide enterprise logging nestjs modules

Projects that are alternatives of or similar to Nestjs Sentry

Sentry
Middleware to integrate with sentry crash reporting.
Stars: ✭ 55 (-31.25%)
Mutual labels:  sentry
Apollo Link Sentry
Apollo Link middleware which enriches SentryJS with GraphQL data
Stars: ✭ 63 (-21.25%)
Mutual labels:  sentry
Nestjs Components
A list of useful components for NestJS applications
Stars: ✭ 72 (-10%)
Mutual labels:  nestjs
Reactivated App
Reactivated.app is an open-source app that scans your JS dependencies every 4 hours and generates cool dashboards
Stars: ✭ 57 (-28.75%)
Mutual labels:  nestjs
Nestjs Monorepo Starter
A full-stack nestjs starter project. Includes authorization, authentication, MongoDB, Redis queue support, Crons jobs, and end-to-end testing.
Stars: ✭ 58 (-27.5%)
Mutual labels:  nestjs
Blog
📚 专注Web与算法
Stars: ✭ 1,140 (+1325%)
Mutual labels:  nestjs
Nestjs Redoc
📘 ReDoc frontend for you NestJS swagger API documentation
Stars: ✭ 54 (-32.5%)
Mutual labels:  nestjs
Sentry Wizard
Sentry Project Setup Wizard
Stars: ✭ 78 (-2.5%)
Mutual labels:  sentry
Nestjs Braintree
A module for braintree reoccurring payments and transactions 💳
Stars: ✭ 62 (-22.5%)
Mutual labels:  nestjs
Purify
All-in-one tool for managing vulnerability reports from AppSec pipelines
Stars: ✭ 72 (-10%)
Mutual labels:  nestjs
Nestia
Automatic SDK and Document generator for the NestJS
Stars: ✭ 57 (-28.75%)
Mutual labels:  nestjs
Genal Chat
🐱‍🏍阿童木聊天室 nestjs+vue全栈聊天室 前后端分离 typescript一把梭
Stars: ✭ 1,105 (+1281.25%)
Mutual labels:  nestjs
Bank
🏦 Full Stack Web Application similar to financial software that is used in banking institutions | React.js and Node.js
Stars: ✭ 1,158 (+1347.5%)
Mutual labels:  nestjs
Tyloo Chat
vue + nestjs IM即时通讯聊天室(仿wechat)
Stars: ✭ 54 (-32.5%)
Mutual labels:  nestjs
Drivine
Best and fastest graph database client (Neo4j & AgensGraph) for Node.js & TypeScript.
Stars: ✭ 74 (-7.5%)
Mutual labels:  nestjs
Pimp My Pr
A brilliant tool that will pimp your pull requests by collecting and presenting PR statistics.
Stars: ✭ 55 (-31.25%)
Mutual labels:  nestjs
Sentry Clj
Sentry SDK for Clojure
Stars: ✭ 63 (-21.25%)
Mutual labels:  sentry
Nestjs Cqrs Starter
NestJS CQRS Microservices Starter Project
Stars: ✭ 80 (+0%)
Mutual labels:  nestjs
Nestjs Roles
Type safe roles guard and decorator made easy
Stars: ✭ 78 (-2.5%)
Mutual labels:  nestjs
Node Blog
🔥✨ A react blog project base on nodejs, nestjs, mongoose, typescript, react, ant-design,nextjs
Stars: ✭ 69 (-13.75%)
Mutual labels:  nestjs

npm version Codecov Coverage ISC license Donate

@ntegral/nestjs-sentry

Provides an injectable sentry.io client to provide enterprise logging nestjs modules

Table Of Contents

About

@ntegral/nestjs-sentry implements a module, SentryModule, which when imported into your nestjs project provides a Sentry.io client to any class that injects it. This lets Sentry.io be worked into your dependency injection workflow without having to do any extra work outside of the initial setup.

Installation

npm install --save @ntegral/nestjs-sentry @sentry/node

Github Sample Project using @ntegral/nestjs-sentry

The following project was created as a sample starter project to get you going... (if needed...).

Getting Started

The simplest way to use @ntegral/nestjs-sentry is to use SentryModule.forRoot

import { Module } from '@nestjs-common';
import { SentryModule } from '@ntegral/nestjs-sentry';
import { LogLevel } from '@sentry/types';

@Module({
  imports: [
    SentryModule.forRoot({
      dsn: 'sentry_io_dsn',
      debug: true | false,
      environment: 'dev' | 'production' | 'some_environment',
      release: 'some_release', | null, // must create a release in sentry.io dashboard
      logLevel: LogLevel.Debug //based on sentry.io loglevel //
    }),
  ],
})
export class AppModule {}

The async way @ntegral/nestjs-sentry is to use SentryModule.forRootAsync

import { Module } from '@nestjs-common';
import { SentryModule } from '@ntegral/nestjs-sentry';
import { ConfigModule } from '@ntegral/nestjs-config';
import { ConfigService } from '@ntegral/nestjs-config';

@Module({
  imports: [
    SentryModule.forRootAsync({
      imports: [ConfigModule],
      useFactory: async (cfg:ConfigService) => ({
        dsn: cfg.get('SENTRY_DSN'),
        debug: true | false,
        environment: 'dev' | 'production' | 'some_environment',
        release: 'some_release', | null, // must create a release in sentry.io dashboard
        logLevel: LogLevel.Debug //based on sentry.io loglevel //
      }),
      inject: [ConfigService],
    })
  ]
})

export class AppModule {}

You can then inject the Sentry client into any of your injectables by using a custom decorator

import { Injectable } from '@nestjs/common';
import { InjectSentry, SentryService } from '@ntegral/nestjs-sentry';

@Injectable()
export class AppService {
  public constructor(@InjectSentry() private readonly client: SentryService) {
      client.instance().captureMessage(message, Sentry.Severity.Log);
      client.instance().captureException(exception);
      ... and more
  }
}

Interceptors

BREAKING CHANGES: The SentryInterceptor can be used in projects that don't require GraphQL. If you will be needed GraphQL support, use the GraphqlInterceptor. Using the GraphqlInterceptor will create a dependancy for the @nestjs/graphql package.

npm install --save @nestjs/graphql

Contributing

I would greatly appreciate any contributions to make this project better. Please make sure to follow the below guidelines before getting your hands dirty.

  1. Fork the repository
  2. Create your branch (git checkout -b my-branch)
  3. Commit any changes to your branch
  4. Push your changes to your remote branch
  5. Open a pull request

License

Distributed under the ISC License. See LICENSE for more information.

Acknowledgements

Copyright © 2019 Ntegral Inc.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].