mirror of
https://github.com/OneUptime/oneuptime.git
synced 2026-04-06 00:32:12 +02:00
refactor: update proto file paths to use relative directory resolution
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user