code: def __get_agent_host_port(self):
          
          host = AGENT_DEFAULT_HOST
          port = AGENT_DEFAULT_PORT
  
          if "INSTANA_AGENT_HOST" in os.environ:
              host = os.environ["INSTANA_AGENT_HOST"]
              if "INSTANA_AGENT_PORT" in os.environ:
                  port = int(os.environ["INSTANA_AGENT_PORT"])
  
          elif "INSTANA_AGENT_IP" in os.environ:
              # Deprecated: INSTANA_AGENT_IP environment variable
              # To be removed in a future version
              host = os.environ["INSTANA_AGENT_IP"]
              if "INSTANA_AGENT_PORT" in os.environ:
                  port = int(os.environ["INSTANA_AGENT_PORT"])
  
          elif self.agent.sensor.options.agent_host != "":
              host = self.agent.sensor.options.agent_host
              if self.agent.sensor.options.agent_port != 0:
                  port = self.agent.sensor.options.agent_port
  
          return host, port
docs: Iterates the the various ways the host and port of the Instana host
          agent may be configured: default, env vars, sensor options...