diff --git a/CommonServer/Utils/Telemetry.ts b/CommonServer/Utils/Telemetry.ts index 155191cef7..6fe5064690 100644 --- a/CommonServer/Utils/Telemetry.ts +++ b/CommonServer/Utils/Telemetry.ts @@ -31,12 +31,12 @@ export default class OneUptimeTelemetry { public static logger: Logger | null = null; public static getHeaders(): Dictionary { - if (!process.env['OTEL_EXPORTER_OTLP_HEADERS']) { + if (!process.env['OPENTELEMETRY_EXPORTER_OTLP_HEADERS']) { return {}; } const headersStrings: Array = - process.env['OTEL_EXPORTER_OTLP_HEADERS'].split(';'); + process.env['OPENTELEMETRY_EXPORTER_OTLP_HEADERS'].split(';'); const headers: Dictionary = {}; @@ -51,11 +51,11 @@ export default class OneUptimeTelemetry { } public static getOtlpEndpoint(): URL | null { - if (!process.env['OTEL_EXPORTER_OTLP_ENDPOINT']) { + if (!process.env['OPENTELEMETRY_EXPORTER_OTLP_ENDPOINT']) { return null; } - return URL.fromString(process.env['OTEL_EXPORTER_OTLP_ENDPOINT'] || ''); + return URL.fromString(process.env['OPENTELEMETRY_EXPORTER_OTLP_ENDPOINT'] || ''); } public static getOltpLogsEndpoint(): URL | null { @@ -113,6 +113,8 @@ export default class OneUptimeTelemetry { traceExporter = new OTLPTraceExporter({ url: this.getOltpTracesEndpoint()!.toString(), headers: headers, + compression: CompressionAlgorithm.GZIP, + }); } @@ -121,6 +123,7 @@ export default class OneUptimeTelemetry { exporter: new OTLPMetricExporter({ url: this.getOltpMetricsEndpoint()!.toString(), headers: headers, + compression: CompressionAlgorithm.GZIP, }), }); } @@ -131,7 +134,7 @@ export default class OneUptimeTelemetry { const logExporter: OTLPLogExporter = new OTLPLogExporter({ url: this.getOltpLogsEndpoint()!.toString(), headers: headers, - compression: CompressionAlgorithm.GZIP, + compression: CompressionAlgorithm.GZIP, }); loggerProvider.addLogRecordProcessor( diff --git a/Ingestor/API/OTelIngest.ts b/Ingestor/API/OTelIngest.ts index 35d1a1ff84..1b89ae50a5 100644 --- a/Ingestor/API/OTelIngest.ts +++ b/Ingestor/API/OTelIngest.ts @@ -62,9 +62,7 @@ class OpenTelemetryRequestMiddleware { ): Promise { try { let productType: ProductType; - - debugger; - + const isProtobuf: boolean = req.body instanceof Uint8Array; if (req.url.includes('/otlp/v1/traces')) { diff --git a/docker-compose.base.yml b/docker-compose.base.yml index 6b6cf6ffa7..19e1a049b8 100644 --- a/docker-compose.base.yml +++ b/docker-compose.base.yml @@ -234,8 +234,8 @@ services: INTERNAL_SMTP_EMAIL: ${INTERNAL_SMTP_EMAIL} INTERNAL_SMTP_FROM_NAME: ${INTERNAL_SMTP_FROM_NAME} INTERNAL_SMTP_PASSWORD: ${INTERNAL_SMTP_PASSWORD} - OTEL_EXPORTER_OTLP_ENDPOINT: ${OTEL_EXPORTER_OTLP_ENDPOINT} - OTEL_EXPORTER_OTLP_HEADERS: ${APP_OTEL_EXPORTER_OTLP_HEADERS} + OPENTELEMETRY_EXPORTER_OTLP_ENDPOINT: ${OTEL_EXPORTER_OTLP_ENDPOINT} + OPENTELEMETRY_EXPORTER_OTLP_HEADERS: ${APP_OTEL_EXPORTER_OTLP_HEADERS} depends_on: - redis - postgres