@Override
  protected void writeMetricToIoTDB(Map<String, Object> valueMap, String prefix, long time) {
    List<String> sensors = new ArrayList<>();
    List<TSDataType> dataTypes = new ArrayList<>();
    List<Object> values = new ArrayList<>();
    for (Map.Entry<String, Object> sensor : valueMap.entrySet()) {
      sensors.add(sensor.getKey());
      dataTypes.add(inferType(sensor.getValue()));
      values.add(sensor.getValue());
    }

    try {
      sessionPool.insertRecord(prefix, time, sensors, dataTypes, values);
    } catch (IoTDBConnectionException | StatementExecutionException e) {
      LOGGER.warn("IoTDBSessionReporter failed to insert record, because ", e);
    }
  }
The session pool to write metrics.
iotdb-core/metrics/interface/src/main/java/org/apache/iotdb/metrics/reporter/iotdb/IoTDBSessionReporter.java