code: async def send(self, metric):
          
          message = json.dumps(metric).encode('utf-8')
          await self.loop.create_datagram_endpoint(
              lambda: UDPClientProtocol(message),
              remote_addr=(self.ip, self.port))
docs: Transform metric to JSON bytestring and send to server.
  
          Args:
              metric (dict): Complete metric to send as JSON.