UNPKG

backport

Version:

A CLI tool that automates the process of backporting commits

34 lines 1.3 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.disableApm = void 0; const elastic_apm_node_1 = __importDefault(require("elastic-apm-node")); //@ts-expect-error const noop_apm_client_1 = require("elastic-apm-node/lib/apm-client/noop-apm-client"); const logger_1 = require("./logger"); const environment = process.env.NODE_ENV || 'production-cli'; elastic_apm_node_1.default .start({ serviceName: 'backport', secretToken: 'GZui3tX4jFYjszDweu', serverUrl: 'https://f27ab01db9584e008c443b7137d16425.apm.europe-west2.gcp.elastic-cloud.com:443', logLevel: 'off', captureBody: 'all', errorOnAbortedRequests: false, environment, }) // remove access token .addFilter((payload) => { return JSON.parse(JSON.stringify(payload, logger_1.accessTokenReplacer)); }); function disableApm() { // hack to disable APM telemetry after loaded config //@ts-expect-error elastic_apm_node_1.default._apmClient.destroy(); //@ts-expect-error elastic_apm_node_1.default._apmClient = new noop_apm_client_1.NoopApmClient(); } exports.disableApm = disableApm; //# sourceMappingURL=apm.js.map