feat(api): metrics for Spotify API http requests

This will help evaluate how much we are being rate limited, and on what
routes it happens most.
This commit is contained in:
Julian Tölle 2022-06-29 19:58:01 +02:00
parent 85c31705ef
commit 41dfae3c50
7 changed files with 229 additions and 3 deletions

View file

@ -1,6 +1,7 @@
import { Module, OnApplicationShutdown } from "@nestjs/common";
import { Global, Module, OnApplicationShutdown } from "@nestjs/common";
import { OpenTelemetryModule as UpstreamModule } from "nestjs-otel";
import { otelSDK } from "./sdk";
import { UrlValueParserService } from "./url-value-parser.service";
@Module({
imports: [
@ -16,8 +17,10 @@ import { otelSDK } from "./sdk";
},
}),
],
exports: [UpstreamModule],
providers: [UrlValueParserService],
exports: [UpstreamModule, UrlValueParserService],
})
@Global()
export class OpenTelemetryModule implements OnApplicationShutdown {
async onApplicationShutdown(): Promise<void> {
await otelSDK.shutdown();