From cdbbcdfe27d8911f71373cb45f205c7a9e9d526d Mon Sep 17 00:00:00 2001 From: Nawaz Dhandala Date: Thu, 2 Apr 2026 15:23:13 +0100 Subject: [PATCH] refactor: update proto file paths to use relative directory resolution --- .../Telemetry/Middleware/OtelRequestMiddleware.ts | 11 +++++++---- .../Telemetry/Services/PyroscopeIngestService.ts | 3 ++- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/App/FeatureSet/Telemetry/Middleware/OtelRequestMiddleware.ts b/App/FeatureSet/Telemetry/Middleware/OtelRequestMiddleware.ts index 61173296ef..30efe60a9a 100644 --- a/App/FeatureSet/Telemetry/Middleware/OtelRequestMiddleware.ts +++ b/App/FeatureSet/Telemetry/Middleware/OtelRequestMiddleware.ts @@ -9,24 +9,27 @@ import { import CaptureSpan from "Common/Server/Utils/Telemetry/CaptureSpan"; import protobuf from "protobufjs"; import logger from "Common/Server/Utils/Logger"; +import path from "path"; // Load proto file for OTel +const PROTO_DIR: string = path.resolve(__dirname, "..", "ProtoFiles", "OTel", "v1"); + // Create a root namespace const LogsProto: protobuf.Root = protobuf.loadSync( - "/usr/src/app/ProtoFiles/OTel/v1/logs.proto", + path.join(PROTO_DIR, "logs.proto"), ); const TracesProto: protobuf.Root = protobuf.loadSync( - "/usr/src/app/ProtoFiles/OTel/v1/traces.proto", + path.join(PROTO_DIR, "traces.proto"), ); const MetricsProto: protobuf.Root = protobuf.loadSync( - "/usr/src/app/ProtoFiles/OTel/v1/metrics.proto", + path.join(PROTO_DIR, "metrics.proto"), ); const ProfilesProto: protobuf.Root = protobuf.loadSync( - "/usr/src/app/ProtoFiles/OTel/v1/profiles.proto", + path.join(PROTO_DIR, "profiles.proto"), ); // Lookup the message type diff --git a/App/FeatureSet/Telemetry/Services/PyroscopeIngestService.ts b/App/FeatureSet/Telemetry/Services/PyroscopeIngestService.ts index 57d1c8ad40..c8c492437b 100644 --- a/App/FeatureSet/Telemetry/Services/PyroscopeIngestService.ts +++ b/App/FeatureSet/Telemetry/Services/PyroscopeIngestService.ts @@ -10,12 +10,13 @@ import BadRequestException from "Common/Types/Exception/BadRequestException"; import { JSONObject } from "Common/Types/JSON"; import ObjectID from "Common/Types/ObjectID"; import protobuf from "protobufjs"; +import path from "path"; import zlib from "zlib"; import ProfilesQueueService from "./Queue/ProfilesQueueService"; // Load pprof proto schema const PprofProto: protobuf.Root = protobuf.loadSync( - "/usr/src/app/ProtoFiles/pprof/profile.proto", + path.resolve(__dirname, "..", "ProtoFiles", "pprof", "profile.proto"), ); const PprofProfile: protobuf.Type = PprofProto.lookupType( "perftools.profiles.Profile",