docs: @Override
    public void export(Collection<SpanData> spanDataList) {
      Scope scope =
          tracer
              .spanBuilder("ExportElasticsearchTraces")
              .setSampler(probabilitySampler)
              .setRecordEvents(true)
              .startScopedSpan();
      try {
        List<String> jsonList = JsonConversionUtils.convertToJson(appName, spanDataList);
        if (jsonList.isEmpty()) {
          return;
        }
        for (String json : jsonList) {
  
          OutputStream outputStream = null;
          InputStream inputStream = null;
  
          try {
            HttpURLConnection connection = (HttpURLConnection) indexUrl.openConnection();
            if (elasticsearchTraceConfiguration.getUserName() != null) {
              String parameters =
                  BaseEncoding.base64()
                      .encode(
                          (elasticsearchTraceConfiguration.getUserName()
                                  + ":"
                                  + elasticsearchTraceConfiguration.getPassword())
                              .getBytes("UTF-8"));
              connection.setRequestProperty("Authorization", "Basic " + parameters);
            }
            connection.setRequestMethod(REQUEST_METHOD);
            connection.setDoOutput(true);
            connection.setConnectTimeout(CONNECTION_TIMEOUT_MILLISECONDS);
            connection.setRequestProperty("Content-Type", CONTENT_TYPE);
            outputStream = connection.getOutputStream();
            outputStream.write(json.getBytes(Charset.defaultCharset()));
            outputStream.flush();
            inputStream = connection.getInputStream();
            if (connection.getResponseCode() != 200) {
              tracer
                  .getCurrentSpan()
                  .setStatus(
                      Status.UNKNOWN.withDescription("Response " + connection.getResponseCode()));
            }
          } catch (IOException e) {
            tracer
                .getCurrentSpan()
                .setStatus(
                    Status.UNKNOWN.withDescription(
                        e.getMessage() == null ? e.getClass().getSimpleName() : e.getMessage()));
            // dropping span batch
          } finally {
            if (inputStream != null) {
              try {
                inputStream.close();
              } catch (IOException e) {
                // ignore
              }
            }
            if (outputStream != null) {
              try {
                outputStream.close();
              } catch (IOException e) {
                // ignore
              }
            }
          }
        }
      } finally {
        scope.close();
      }
    }