Skip to content

Commit

Permalink
allow override of hostname, tags with env
Browse files Browse the repository at this point in the history
add platform env
  • Loading branch information
leeliu committed Feb 2, 2017
1 parent ee82968 commit ee64c58
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
8 changes: 7 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,13 @@ checkElevated()

// debug(console.log(config));

config.hostname = parsedConfig.hostname || os.hostname().replace('.ec2.internal', '');
config.hostname = process.env.LOGDNA_HOSTNAME || config.hostname || os.hostname().replace('.ec2.internal', '');
config.tags = process.env.LOGDNA_TAGS || config.tags;

if (process.env.LOGDNA_PLATFORM) {
config.platform = process.env.LOGDNA_PLATFORM;
config.tags = config.tags ? config.tags + ',' + config.platform : config.platform;
}

return distro()
.catch(() => {});
Expand Down
1 change: 1 addition & 0 deletions lib/api-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ module.exports.getAuthToken = function(config, agentName, socket) {
mac: config.mac,
ip: config.ip,
tags: config.tags,
platform: config.platform,
agentname: agentName,
agentversion: pkg.version,
osdist: config.osdist,
Expand Down

0 comments on commit ee64c58

Please sign in to comment.