Skip to content

filipeversehgi/greenyellow-nestjs-observability

Repository files navigation

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

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published