diff options
author | Chocobozzz <me@florianbigard.com> | 2022-11-15 13:56:04 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2022-11-15 13:56:04 +0100 |
commit | 31a9ed960ff1013940d677cb56f83ecd90a93e26 (patch) | |
tree | 33eb418727a762793a62839fb8d039b96e5b9c9b /server/lib/opentelemetry/metrics.ts | |
parent | 077600e03774203c57ba7e8b122bd18faa3e51e6 (diff) | |
download | PeerTube-31a9ed960ff1013940d677cb56f83ecd90a93e26.tar.gz PeerTube-31a9ed960ff1013940d677cb56f83ecd90a93e26.tar.zst PeerTube-31a9ed960ff1013940d677cb56f83ecd90a93e26.zip |
Add configuration for prometheus exporter hostname
Diffstat (limited to 'server/lib/opentelemetry/metrics.ts')
-rw-r--r-- | server/lib/opentelemetry/metrics.ts | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/server/lib/opentelemetry/metrics.ts b/server/lib/opentelemetry/metrics.ts index fc1666604..226d514c0 100644 --- a/server/lib/opentelemetry/metrics.ts +++ b/server/lib/opentelemetry/metrics.ts | |||
@@ -1,5 +1,5 @@ | |||
1 | import { Application, Request, Response } from 'express' | 1 | import { Application, Request, Response } from 'express' |
2 | import { Meter, metrics } from '@opentelemetry/api-metrics' | 2 | import { Meter, metrics } from '@opentelemetry/api' |
3 | import { PrometheusExporter } from '@opentelemetry/exporter-prometheus' | 3 | import { PrometheusExporter } from '@opentelemetry/exporter-prometheus' |
4 | import { MeterProvider } from '@opentelemetry/sdk-metrics' | 4 | import { MeterProvider } from '@opentelemetry/sdk-metrics' |
5 | import { logger } from '@server/helpers/logger' | 5 | import { logger } from '@server/helpers/logger' |
@@ -52,7 +52,10 @@ class OpenTelemetryMetrics { | |||
52 | ] | 52 | ] |
53 | }) | 53 | }) |
54 | 54 | ||
55 | provider.addMetricReader(new PrometheusExporter({ port: CONFIG.OPEN_TELEMETRY.METRICS.PROMETHEUS_EXPORTER.PORT })) | 55 | provider.addMetricReader(new PrometheusExporter({ |
56 | host: CONFIG.OPEN_TELEMETRY.METRICS.PROMETHEUS_EXPORTER.HOSTNAME, | ||
57 | port: CONFIG.OPEN_TELEMETRY.METRICS.PROMETHEUS_EXPORTER.PORT | ||
58 | })) | ||
56 | 59 | ||
57 | metrics.setGlobalMeterProvider(provider) | 60 | metrics.setGlobalMeterProvider(provider) |
58 | 61 | ||