1
0
Fork 0

Fix deprecated OTEL API

This commit is contained in:
Chocobozzz 2024-02-21 16:24:21 +01:00
parent d7edb2f8fe
commit 971077bccd
No known key found for this signature in database
GPG key ID: 583A612D890159BE

View file

@ -51,14 +51,15 @@ class OpenTelemetryMetrics {
const provider = new MeterProvider({
views: [
...NodeJSObserversBuilder.getViews()
],
readers: [
new PrometheusExporter({
host: CONFIG.OPEN_TELEMETRY.METRICS.PROMETHEUS_EXPORTER.HOSTNAME,
port: CONFIG.OPEN_TELEMETRY.METRICS.PROMETHEUS_EXPORTER.PORT
})
]
})
provider.addMetricReader(new PrometheusExporter({
host: CONFIG.OPEN_TELEMETRY.METRICS.PROMETHEUS_EXPORTER.HOSTNAME,
port: CONFIG.OPEN_TELEMETRY.METRICS.PROMETHEUS_EXPORTER.PORT
}))
metrics.setGlobalMeterProvider(provider)
this.meter = metrics.getMeter('default')