{"repo":"pragmaticivan/nestjs-otel","free":true,"listed":false,"github":"https://github.com/pragmaticivan/nestjs-otel","clone":"git clone https://github.com/pragmaticivan/nestjs-otel.git","description":"OpenTelemetry (Tracing + Metrics) module for Nest framework (node.js) 🔭","language":"TypeScript","stars":792,"topics":["observability","nestjs","opentelemetry","typescript","nodejs","prometheus","hacktoberfest","nest","metrics"],"license":"Apache-2.0","category":"analytics","readme_excerpt":"NestJS OpenTelemetry (OTEL) Description OpenTelemetry module for Nest. Why Setting up observability metrics with nestjs requires multiple libraries and patterns. OpenTelemetry has support for multiple exporters and types of metrics such as Prometheus Metrics. Observability Please read this comprehensive whitepaper if that's your first time working with metrics, tracing, and logs. Examples A full working examples are available. This includes a nestjs application fully integrated with prometheus, grafana, loki and tempo: - nestjs-otel-prom-grafana-tempo Installation Setup Some peers dependencies are required when some configurations are enabled. 1. Create tracing file ( tracing.ts ): 2. Import the metric file and start otel node SDK: 3. Configure nest-otel: 3.1. With forRoot : 3.2. With forRootAsync : Span Decorator If you need, you can define a custom Tracing Span for a method. It works async or sync. Span optionally takes one or both of the following parameters: name - explicit name of the span; if omitted, it is derived as . . options - SpanOptions to customize the span options. You can also supply a function as the options argument. It will be called with the decorated method's arguments, so you can dynamically customize the span options. Traceable Decorator If you want to trace all methods in a class, you can use the @Traceable decorator. Current Span Decorator You can access the current span in your controllers using the @CurrentSpan decorator. Note: This decorator only w","default_branch":null,"files":null,"tree":[],"storefront":"/r/pragmaticivan","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/pragmaticivan/nestjs-otel/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}