plugin/src/main/java/org/opensearch/sql/plugin/rest/RestPPLStatsAction.java [68:81]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  protected RestChannelConsumer prepareRequest(RestRequest request, NodeClient client) {

    LogUtils.addRequestId();

    try {
      return channel -> channel.sendResponse(new BytesRestResponse(RestStatus.OK,
          Metrics.getInstance().collectToJSON()));
    } catch (Exception e) {
      LOG.error("Failed during Query PPL STATS Action.", e);

      return channel -> channel.sendResponse(new BytesRestResponse(SERVICE_UNAVAILABLE,
          ErrorMessageFactory.createErrorMessage(e, SERVICE_UNAVAILABLE.getStatus()).toString()));
    }
  }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



legacy/src/main/java/org/opensearch/sql/legacy/plugin/RestSqlStatsAction.java [68:81]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    protected RestChannelConsumer prepareRequest(RestRequest request, NodeClient client) {

        LogUtils.addRequestId();

        try {
            return channel -> channel.sendResponse(new BytesRestResponse(RestStatus.OK,
                    Metrics.getInstance().collectToJSON()));
        } catch (Exception e) {
            LOG.error("Failed during Query SQL STATS Action.", e);

            return channel -> channel.sendResponse(new BytesRestResponse(SERVICE_UNAVAILABLE,
                    ErrorMessageFactory.createErrorMessage(e, SERVICE_UNAVAILABLE.getStatus()).toString()));
        }
    }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



