@dynatrace/opentelemetry-core
Version:
Dynatrace OpenTelemetry core package
64 lines (61 loc) • 4.3 kB
JavaScript
;
/*
Copyright 2022 Dynatrace LLC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.logStartupBanner = logStartupBanner;
const os = require("os");
const proto_version_1 = require("../../gen/proto/proto-version");
const SemConvTrace_1 = require("../../gen/dynatrace/odin/semconv/v1/SemConvTrace");
const Logger_1 = require("../Logger");
const StartupConfig_1 = require("../configuration/StartupConfig");
const LoggingUtils_1 = require("./LoggingUtils");
const version_1 = require("../version");
const NumericUtils_1 = require("./NumericUtils");
// ----------------------------------------------------------------------------
function logStartupBanner() {
var _a, _b, _c, _d, _e;
const log = new Logger_1.ComponentLogger("Core");
const config = (0, StartupConfig_1.getConfiguration)();
const { fullVersion, buildDate, commitHash, isDevVersion } = version_1.VERSIONS;
log.info(`OneAgent ODIN Node.js version .. ${fullVersion}, build date ${buildDate}, SCM Rev. ${commitHash}`);
if (isDevVersion) {
const disclaimer = `This is a development version (${fullVersion}) and not intended for use in production environments`;
if (log.enabled) {
log.info(disclaimer);
}
else {
// eslint-disable-next-line no-console
console.error(`[Dynatrace] ${disclaimer}`);
}
}
log.info(`Exporter ID .................... 0x${(_a = (0, NumericUtils_1.toUlong)(config === null || config === void 0 ? void 0 : config.agentID)) === null || _a === void 0 ? void 0 : _a.toString(16)}`);
log.info(`Tenant ID ...................... 0x${(_b = (0, NumericUtils_1.toUint32)(config === null || config === void 0 ? void 0 : config.tenantId)) === null || _b === void 0 ? void 0 : _b.toString(16)}`);
log.info(`Cluster ID ..................... 0x${(_c = (0, NumericUtils_1.toUint32)(config === null || config === void 0 ? void 0 : config.clusterId)) === null || _c === void 0 ? void 0 : _c.toString(16)}`);
log.info(`Tenant UUID .................... ${config === null || config === void 0 ? void 0 : config.tenantUUID}`);
log.info(`Connection URL ................. ${config === null || config === void 0 ? void 0 : config.baseUrl}`);
log.info(`Process ID ..................... ${process.pid}`);
log.info(`Platform ....................... ${os.platform()} - ${os.arch()} - ${os.release()}`);
log.info(`Host ........................... ${os.hostname()}`);
log.info(`Runtime ........................ ${process.release.name} - ${process.version}`);
log.info(`Span processing interval ....... ${config === null || config === void 0 ? void 0 : config.spanProcessingIntervalMs}`);
log.info(`Logging flags .................. ${(0, LoggingUtils_1.prettyPrintObject)((_d = config === null || config === void 0 ? void 0 : config.loggingFlags) !== null && _d !== void 0 ? _d : {})}`);
log.info(`Rum ClientIp Headers ........... ${config === null || config === void 0 ? void 0 : config.rumClientIpHeaders}`);
log.info(`Rum Application ID ............. ${config === null || config === void 0 ? void 0 : config.rumApplicationId}`);
log.info(`Process arguments .............. [${process.argv.join(", ")}]`);
log.info(`Special arguments .............. [${process.execArgv.join(", ")}]`);
log.info(`NODE_OPTIONS ................... ${process.env.NODE_OPTIONS}`);
log.info(`Main Module .................... ${(_e = require.main) === null || _e === void 0 ? void 0 : _e.filename}`);
log.info(`Protocol version ............... ${proto_version_1.PROTO_VERSION}`);
log.info(`SemConv version ................ ${SemConvTrace_1.ARTIFACT_VERSION}`);
}
//# sourceMappingURL=StartupBanner.js.map