NestJS-Monitor
Introduction
stencil
comes with out of the box support for creating grafana dashboards
automatically using custom made NestJS Interceptors
which generate the dashboard JSONs automatically.
Features
- Automatic creation of
grafana
panels. - Automatic updation of panel JSONs upon addition of new instances of
ResponseTimeInterceptor
in the NestJS app. - Each instance of
ResponseTimeInterceptor
corresponds to a newrow
in the response_timesdashboard
. - Each row has the following 5 panels.
- Heatmap response times: This is a heatmap of all the response times for a particular instance of the
ResponseTimeInterceptor
. - Guage for number of requests: This gauage tells the number of requests that have arrived at each endpoint being captured by a particular instance of
ResponseTimeInterceptor
. - Average response time graph: This graph gives out information about the average response time for the requests coming through the interceptor.
- Total number of requests graph: This graph tells the total number of requests being received at a particular point of time.
- Number of requests by status codes graph: This graph gives out information about the number of requests grouped by the response HTTP status codes.
To read more about how the interceptor can be used, refer here
To learn more about NestJS interceptor you can refer official NestJS documentation here
A small demo showcasing these interceptors
in action can be found here