mirror of
https://github.com/apricote/Listory.git
synced 2026-01-13 21:21:02 +00:00
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:
parent
85c31705ef
commit
41dfae3c50
7 changed files with 229 additions and 3 deletions
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue