kibana/src/cli/apm.js
Pierre Gayvallet 3c84c7ca58
Move src/apm.js to @kbn/apm-config-loader (#94315) (#94538)
* Move src/apm.js to @kbn/apm-config-loader

* add unit tests for `initApm`

* return undefined instead of empty config

* use ?.
2021-03-14 20:04:44 -04:00

18 lines
743 B
JavaScript

/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0 and the Server Side Public License, v 1; you may not use this file except
* in compliance with, at your election, the Elastic License 2.0 or the Server
* Side Public License, v 1.
*/
const { join } = require('path');
const { name, build } = require('../../package.json');
const { initApm } = require('@kbn/apm-config-loader');
const rootDir = join(__dirname, '../..');
const isKibanaDistributable = Boolean(build && build.distributable === true);
module.exports = function (serviceName = name) {
initApm(process.argv, rootDir, isKibanaDistributable, serviceName);
};