Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MSS-554: Adding instance id #4

Merged
merged 4 commits into from
Dec 6, 2018
Merged

Conversation

markrichardsg
Copy link
Contributor

No description provided.

case awsIdentity: AwsIdentity => Map(
"app" -> awsIdentity.app,
"stack" -> awsIdentity.stack,
"stage" -> awsIdentity.stage
)
case _ => Map("app" -> defaultAppName)
}).mapValues(JsString))
}) ++ Option(EC2MetadataUtils.getInstanceId).map("ec2_instance" -> _)).mapValues(JsString))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know if that method is cached, would it be safer to have a private attribute to store the instance ID at the class level, and re-use that attribute upon later calls?

I'm worried this actually does some sort of processing each time

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

whoAmI already calls getInstanceId so this problem would already exist.

However, to be safe, I've turned the whole app stack stage object into a lazy val

@markrichardsg markrichardsg merged commit af612bc into master Dec 6, 2018
@markrichardsg markrichardsg deleted the MSS-554/add-ec2-instance-id branch December 6, 2018 12:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants