mirror of
https://github.com/apricote/Listory.git
synced 2026-01-13 21:21:02 +00:00
feat(observability): Replace Prometheus package with OpenTelemetry
This commit is contained in:
parent
f67383b761
commit
6b1640b753
22 changed files with 2391 additions and 568 deletions
25
src/open-telemetry/open-telemetry.module.ts
Normal file
25
src/open-telemetry/open-telemetry.module.ts
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
import { Module, OnApplicationShutdown } from "@nestjs/common";
|
||||
import { OpenTelemetryModule as UpstreamModule } from "nestjs-otel";
|
||||
import { otelSDK } from "./sdk";
|
||||
|
||||
@Module({
|
||||
imports: [
|
||||
UpstreamModule.forRoot({
|
||||
metrics: {
|
||||
hostMetrics: true, // Includes Host Metrics
|
||||
defaultMetrics: true, // Includes Default Metrics
|
||||
apiMetrics: {
|
||||
enable: true, // Includes api metrics
|
||||
timeBuckets: [], // You can change the default time buckets
|
||||
ignoreUndefinedRoutes: false, //Records metrics for all URLs, even undefined ones
|
||||
},
|
||||
},
|
||||
}),
|
||||
],
|
||||
exports: [UpstreamModule],
|
||||
})
|
||||
export class OpenTelemetryModule implements OnApplicationShutdown {
|
||||
async onApplicationShutdown(): Promise<void> {
|
||||
await otelSDK.shutdown();
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue