@glosur/nestjs-actuator
TypeScript icon, indicating that this package has built-in type declarations

0.0.3 • Public • Published

Nestjs Actuator

A module to monitor your Nestjs applications.


GitHub npm GitHub top language

Description

Nestjs-actuator is a NestJS module (Typescript) implementation of the Spring Actuator API .

This project was inspired by Pyctuator.

This module aims to register and monitor NestJS application through Spring Boot Admin. However, this module can also be used just to expose the endpoints provided.

The project come with only one hard dependency, @nestjs/schedule which might be removed in the future.

Installation

$ npm install --save @glosur/nestjs-actuator

How to use

Import ActuatorModule into the root ApplicationModule

import { Module } from '@nestjs/common';
import {ActuatorModule} from "./actuator.module";

@Module({
  imports: [
    ActuatorModule.forRoot({
                    registration : {
                       adminServerUrl: 'http://localhost:8080', // URL of the spring boot admin server
                       name: 'myApp', // Name of your app
                       serviceUrl: 'http://localhost:3000', // URL to register with to Spring Boot Admin. This is what Spring Boot Admin will try to call to fetch informations.
                       auth: { // Optional, needed if you secured your Spring Boot Admin Server
                          "username": "username",
                          "password": "pwd"
                       }
                   }
                }),
    ]
})
export class ApplicationModule {}

Supported SBA features

  • Version: Display the version of the app
  • Environment: Display environment variables (Hiding sensible ones)

More to come !

Actuator Endpoints security

This project does not provide any security on the exposed endpoints. Apply a middleware to /actuator to protect it. However make sure to make the Spring Boot Admin Server aware of those security concerns through metadata.

Compatibility version

This module has only be tested againt NestJS 7+. It might work with lower versions.

License

MIT licensed

Package Sidebar

Install

npm i @glosur/nestjs-actuator

Weekly Downloads

1

Version

0.0.3

License

MIT

Unpacked Size

42.3 kB

Total Files

40

Last publish

Collaborators

  • glosur