aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/opentelemetry/metrics.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2022-07-27 16:19:25 +0200
committerChocobozzz <me@florianbigard.com>2022-07-27 16:19:25 +0200
commitadc94cf09c86112051f72055852efcc977e4a04a (patch)
treeae6f25824c1e66004fa69aa9f685642d8d7ad8b4 /server/lib/opentelemetry/metrics.ts
parent50cc1ee48aacb6e7d6513c0f108492a589b515ea (diff)
downloadPeerTube-adc94cf09c86112051f72055852efcc977e4a04a.tar.gz
PeerTube-adc94cf09c86112051f72055852efcc977e4a04a.tar.zst
PeerTube-adc94cf09c86112051f72055852efcc977e4a04a.zip
Add live and viewers otel metrics
Diffstat (limited to 'server/lib/opentelemetry/metrics.ts')
-rw-r--r--server/lib/opentelemetry/metrics.ts14
1 files changed, 13 insertions, 1 deletions
diff --git a/server/lib/opentelemetry/metrics.ts b/server/lib/opentelemetry/metrics.ts
index 149f421be..ffe493670 100644
--- a/server/lib/opentelemetry/metrics.ts
+++ b/server/lib/opentelemetry/metrics.ts
@@ -4,7 +4,13 @@ import { PrometheusExporter } from '@opentelemetry/exporter-prometheus'
4import { MeterProvider } from '@opentelemetry/sdk-metrics-base' 4import { MeterProvider } from '@opentelemetry/sdk-metrics-base'
5import { logger } from '@server/helpers/logger' 5import { logger } from '@server/helpers/logger'
6import { CONFIG } from '@server/initializers/config' 6import { CONFIG } from '@server/initializers/config'
7import { JobQueueObserversBuilder, NodeJSObserversBuilder, StatsObserversBuilder } from './metric-helpers' 7import {
8 JobQueueObserversBuilder,
9 LivesObserversBuilder,
10 NodeJSObserversBuilder,
11 StatsObserversBuilder,
12 ViewersObserversBuilder
13} from './metric-helpers'
8 14
9class OpenTelemetryMetrics { 15class OpenTelemetryMetrics {
10 16
@@ -53,6 +59,12 @@ class OpenTelemetryMetrics {
53 59
54 const statsObserversBuilder = new StatsObserversBuilder(this.meter) 60 const statsObserversBuilder = new StatsObserversBuilder(this.meter)
55 statsObserversBuilder.buildObservers() 61 statsObserversBuilder.buildObservers()
62
63 const livesObserversBuilder = new LivesObserversBuilder(this.meter)
64 livesObserversBuilder.buildObservers()
65
66 const viewersObserversBuilder = new ViewersObserversBuilder(this.meter)
67 viewersObserversBuilder.buildObservers()
56 } 68 }
57 69
58 private buildRequestObserver () { 70 private buildRequestObserver () {