code: def instance_ip_grouping_key():
      
      with closing(socket.socket(socket.AF_INET, socket.SOCK_DGRAM)) as s:
          s.connect(('localhost', 0))
          return {'instance': s.getsockname()[0]}
docs: Grouping key with instance set to the IP Address of this host.