<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def write(self, name, **data):
 """ Write the metric to elasticsearch Args: name (str):
 The name of the metric to write data (dict):
 Additional data to store with the metric """


        data["name"] = name
        if not ("timestamp" in data):
            data["timestamp"] = datetime.utcnow()

        try:
            self.client.index(
                index=self.get_index(),
                doc_type=self.doc_type,
                id=None,
                body=data
            )
        except TransportError as exc:
            logger.warning('writing metric %r failure %r', data, exc)