diff options
author | Chocobozzz <me@florianbigard.com> | 2022-07-27 16:19:25 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2022-07-27 16:19:25 +0200 |
commit | adc94cf09c86112051f72055852efcc977e4a04a (patch) | |
tree | ae6f25824c1e66004fa69aa9f685642d8d7ad8b4 /server/lib/opentelemetry/metrics.ts | |
parent | 50cc1ee48aacb6e7d6513c0f108492a589b515ea (diff) | |
download | PeerTube-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.ts | 14 |
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' | |||
4 | import { MeterProvider } from '@opentelemetry/sdk-metrics-base' | 4 | import { MeterProvider } from '@opentelemetry/sdk-metrics-base' |
5 | import { logger } from '@server/helpers/logger' | 5 | import { logger } from '@server/helpers/logger' |
6 | import { CONFIG } from '@server/initializers/config' | 6 | import { CONFIG } from '@server/initializers/config' |
7 | import { JobQueueObserversBuilder, NodeJSObserversBuilder, StatsObserversBuilder } from './metric-helpers' | 7 | import { |
8 | JobQueueObserversBuilder, | ||
9 | LivesObserversBuilder, | ||
10 | NodeJSObserversBuilder, | ||
11 | StatsObserversBuilder, | ||
12 | ViewersObserversBuilder | ||
13 | } from './metric-helpers' | ||
8 | 14 | ||
9 | class OpenTelemetryMetrics { | 15 | class 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 () { |