From 971dbeacfebea765dc152f9dd2615a672dd229e0 Mon Sep 17 00:00:00 2001 From: Filippo Vecchiato Date: Mon, 19 Aug 2024 14:10:45 +0200 Subject: [PATCH] update loki transport --- src/logging/Log.ts | 14 ++++++++------ src/main.ts | 2 +- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/logging/Log.ts b/src/logging/Log.ts index 502f46c05..a3512960a 100644 --- a/src/logging/Log.ts +++ b/src/logging/Log.ts @@ -16,10 +16,10 @@ import { createLogger, Logger } from 'winston'; import { ConsoleTransportInstance, FileTransportInstance } from 'winston/lib/winston/transports'; +import LokiTransport from 'winston-loki'; import { SidecarConfig } from '../SidecarConfig'; import { consoleTransport, fileTransport } from './transports'; -import LokiTransport from 'winston-loki'; /** * Access a singleton winston.Logger that will be intialized on first use. @@ -42,11 +42,13 @@ export class Log { } if (SidecarConfig.config.METRICS.ENABLED) { - this._transports.push(new LokiTransport({ - host: `http://${SidecarConfig.config.METRICS.LOKI_HOST}:${SidecarConfig.config.METRICS.LOKI_PORT}`, - useWinstonMetaAsLabels: true, - json: true, - })) + this._transports.push( + new LokiTransport({ + host: `http://${SidecarConfig.config.METRICS.LOKI_HOST}:${SidecarConfig.config.METRICS.LOKI_PORT}`, + useWinstonMetaAsLabels: true, + json: true, + }), + ); } this._logger = createLogger({ diff --git a/src/main.ts b/src/main.ts index 6c7ac2bc1..ffcf7baa8 100644 --- a/src/main.ts +++ b/src/main.ts @@ -69,7 +69,7 @@ async function main() { if (config.METRICS.ENABLED) { // Create Metrics App - const metricsApp = new Metrics_App({ + const metricsApp = new MetricsApp({ port: config.METRICS.PROM_PORT, host: config.METRICS.PROM_HOST, });