0.0.0 • Published 2 years ago

@greenyellowbr/nestjs-observability v0.0.0

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
2 years ago

NestJs Observability Lib

OpenTelemetry module for Nest.

This repository is based on a fork of NestJs Otel, more tailored for the use we make inside our organization.

What's Included

  • Pino Logger
  • OpenTelemetry + Node Auto Instrumentation
  • Prometheus Metric Endpoint

The general idea is to:

  • Have Pino Logger providing JSON-Text logs to stdout that will be captured by Promtail
  • Have a /metrics endpoint with prometheus metric data that will be captured by their Service Discovery system
  • Have a Tracing framework that will publish traces in the Jeager format to Grafana Tempo

Prerequisites

  • Node 14+
  • NestJs 7+

How to Install

Install

npm i @gy/nestjs-observability --save-dev
yarn add @gy/nestjs-observability

Configure the Env Vars

You need to pass the Telemetry endpoint via environment variables. The endpoint will depend on where your Jaeger Collection will be deployed.

OTEL_SERVICE_NAME=ams-backoffice-api
OTEL_EXPORTER_JAEGER_ENDPOINT=http://localhost:14268/api/traces%

How to Use

Please refer to each module own documentation:

How to Contribute

  • After the improovements are done, bump the version in package.json
  • Run npm publish