in src/setup.py [0:0]
def _configure_hostname(self):
try:
instance_id = self.metadata_reader.get_instance_id()
if self.non_interactive:
self.config.host = instance_id
else:
choice = Prompt("\nChoose hostname for published metrics:", ["EC2 instance id [" + instance_id + "]", "Custom"],
default="1").run()
if choice == "2":
self.config.host = self._get_hostname()
except MetadataRequestException:
print(Color.yellow("\nEC2 instance id could not be automatically detected."))
self.config.host = self._get_hostname()