Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lasylv/nestjs-actuator
Allow monitoring NestJS applications through Spring Boot Admin
https://github.com/lasylv/nestjs-actuator
monitoring nest nestjs spring-boot-admin
Last synced: 27 days ago
JSON representation
Allow monitoring NestJS applications through Spring Boot Admin
- Host: GitHub
- URL: https://github.com/lasylv/nestjs-actuator
- Owner: LaSylv
- License: mit
- Created: 2020-05-22T21:27:17.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-09-25T20:01:19.000Z (over 1 year ago)
- Last Synced: 2024-12-18T03:48:38.986Z (28 days ago)
- Topics: monitoring, nest, nestjs, spring-boot-admin
- Language: TypeScript
- Size: 1.65 MB
- Stars: 2
- Watchers: 0
- Forks: 0
- Open Issues: 29
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Nestjs Actuator
A module to monitor your Nestjs applications.
## Description
Nestjs-actuator is a [NestJS](https://nestjs.com/) module (Typescript) implementation of the [Spring Actuator API](https://docs.spring.io/spring-boot/docs/current/actuator-api/html/#info) .
This project was inspired by [Pyctuator](https://github.com/SolarEdgeTech/pyctuator).
This module aims to register and monitor NestJS application through [Spring Boot Admin](https://github.com/codecentric/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
```bash
$ npm install --save @glosur/nestjs-actuator
```## How to use
Import `ActuatorModule` into the root `ApplicationModule`
```typescript
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"
},
metadata: {} // Optional, additionals metadata
}
}),
]
})
export class ApplicationModule {}
```### Supported SBA features
* **Version:** Display the version of the app
* **Environment:** Display environment variables (Hiding sensible ones)
* **Http traces:** Display the last 100 http calls to your applicationMore 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.
## Known caveats
Due to how works interceptors in NestJS, some calls can't be seen in the Http Traces tab. Those calls are the one not mapped to any route.
Also, exception filters getting triggered after interceptors means the status code can sometimee be missing## License
MIT licensed