@Override
    public void operationComplete(Future<PooledConnection> connectResult) {
        // MUST run this within bindingcontext to support ThreadVariables.
        try {
            methodBinding.bind(() -> {
                DiscoveryResult server = chosenServer.get();

                /* TODO(argha-c): This reliance on mutable update of the `chosenServer` must be improved.
                 * @see DiscoveryResult.EMPTY indicates that the loadbalancer found no available servers.
                 */
                if (!Objects.equals(server, DiscoveryResult.EMPTY)) {
                    if (currentRequestStat != null) {
                        currentRequestStat.server(server);
                    }

                    origin.onRequestStartWithServer(zuulRequest, server, attemptNum);
                }

                // Handle the connection establishment result.
                if (connectResult.isSuccess()) {
                    onOriginConnectSucceeded(connectResult.getNow(), timeLeftForAttempt);
                } else {
                    onOriginConnectFailed(connectResult.cause());
                }
            });
        } catch (Throwable ex) {
            logger.error(
                    "Uncaught error in operationComplete(). Closing the server channel now. {}",
                    ChannelUtils.channelInfoForLogging(channelCtx.channel()),
                    ex);

            unlinkFromOrigin();

            // Fire exception here to ensure that server channel gets closed, so clients don't hang.
            channelCtx.fireExceptionCaught(ex);
        }
    }
Override to track your own request stats.
zuul-core/src/main/java/com/netflix/zuul/filters/endpoint/ProxyEndpoint.java