@subbul/nestjs-plugin
v1.1.0
Published
Subbul SDK for tracking metrics in your NestJS api
Downloads
1
Readme
Subbul Fastify Plugin
NestJS plugin for Subbul - track your APIs core metrics with a few lines of code.
Overview
Plug in the SDK into your Fastify application and instantly start tracking metrics such as
- Response times
- Requests per minute
- HTTP Status Codes
- Custom metrics
Once you are tracking your metrics, create alarms against them using the Subbul dashboard.
Quick start
import { MiddlewareConsumer, Module } from '@nestjs/common';
import { AppController } from './app.controller';
import { AppService } from './app.service';
import { Subbul, SubbulAllMetricsMiddleware, SubbulConfig } from '@subbul/nestjs-plugin';
const {
initializeMiddleware,
coreLibrary
} = Subbul({
licenseKey: '<LICENSE KEY HERE>',
})
@Module({
imports: [SubbulConfig.register(coreLibrary)],
controllers: [AppController],
providers: [AppService],
})
export class AppModule {
async configure(consumer: MiddlewareConsumer) {
await initializeMiddleware(consumer, SubbulAllMetricsMiddleware())
}
}
Documentation
Visit the documentation for an extensive overview of this package.