Send actor's data to server side actor socket

Hi All,
I am a novice to scala and actor system and facing some difficulties on sending an actor’s data to server side actor written in scala.

Following is the actor data( in scala ) that I want to send to a server side socket ,I am not sure on where to start from.

class ConsumerCPUMetrics(target:ActorRef[MetricsWriting])(implicit val materializer: Materializer) {
  val conf: Config = ConfigFactory.load()
  val ipList: util.List[String] = conf.getStringList("assets.ip_list")
  val nameList: util.List[String] = conf.getStringList("assets.name_list")

val metricsJson =new JSONObject(msg.value())
        val instance = metricsJson.getJSONObject("labels").getString("instance")
        val metric = metricsJson.getJSONObject("labels").getString("__name__")
        val timeval = metricsJson.getString("timestamp")
        var mountPoint = ""
          mountPoint =metricsJson.getJSONObject("labels").getString("mountpoint")
        val timevalue1 = DateTime.parse(timeval)
        val timevalue = new Timestamp(timevalue1.getMillis())
        if (ipList.toArray.contains(instance)){
          val index = ipList.toArray.indexOf(instance)
          if(metric.equals(conf.getString("assets.cpu"))) {
          val cpuPercentage = metricsJson.getDouble("value")
          target !writeMetrics(cpuPercentage,timevalue,"CPU",nameList.get(index))