From 5847724474b9a1d94679e347ca2c24d2b10d0b20 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 5 Jan 2023 10:19:51 +0100 Subject: Add tracker opentelemtry metrics --- server/lib/opentelemetry/metrics.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'server/lib/opentelemetry/metrics.ts') diff --git a/server/lib/opentelemetry/metrics.ts b/server/lib/opentelemetry/metrics.ts index 226d514c0..9cc067e4a 100644 --- a/server/lib/opentelemetry/metrics.ts +++ b/server/lib/opentelemetry/metrics.ts @@ -7,6 +7,7 @@ import { CONFIG } from '@server/initializers/config' import { MVideoImmutable } from '@server/types/models' import { PlaybackMetricCreate } from '@shared/models' import { + BittorrentTrackerObserversBuilder, JobQueueObserversBuilder, LivesObserversBuilder, NodeJSObserversBuilder, @@ -41,7 +42,7 @@ class OpenTelemetryMetrics { }) } - registerMetrics () { + registerMetrics (options: { trackerServer: any }) { if (CONFIG.OPEN_TELEMETRY.METRICS.ENABLED !== true) return logger.info('Registering Open Telemetry metrics') @@ -80,6 +81,9 @@ class OpenTelemetryMetrics { const viewersObserversBuilder = new ViewersObserversBuilder(this.meter) viewersObserversBuilder.buildObservers() + + const bittorrentTrackerObserversBuilder = new BittorrentTrackerObserversBuilder(this.meter, options.trackerServer) + bittorrentTrackerObserversBuilder.buildObservers() } observePlaybackMetric (video: MVideoImmutable, metrics: PlaybackMetricCreate) { -- cgit v1.2.3