We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 989a349 commit 1af7980Copy full SHA for 1af7980
1 file changed
src/apm.js
@@ -25,15 +25,13 @@ module.exports = function (serviceName = name) {
25
if (process.env.kbnWorkerType === 'optmzr') return;
26
27
const conf = {
28
- serviceName: `${serviceName}-${version.replace(/\./g, '_')}`
+ serviceName: `${serviceName}-${version.replace(/\./g, '_')}`,
29
};
30
31
- if (configFileExists()) conf.configFile = 'config/apm.js';
+ const configFile = join(__dirname, '..', 'config', 'apm.js');
32
+
33
+ if (existsSync(configFile)) conf.configFile = configFile;
34
else conf.active = false;
35
36
require('elastic-apm-node').start(conf);
37
-
-function configFileExists() {
38
- return existsSync(join(__dirname, '..', 'config', 'apm.js'));
39
-}
0 commit comments