public void handleResponse()

in aws-xray-agent/src/main/java/com/amazonaws/xray/agent/runtime/handlers/downstream/HttpClientHandler.java [93:109]


    public void handleResponse(Event event) {
        HttpServiceDownstreamResponseEvent responseEvent = (HttpServiceDownstreamResponseEvent) event;

        // Check again if this is an X-Ray sampling call or within an AWS call.
        // By this time, the request handler would've executed the same logic and didn't generate a subsegment.
        HttpServiceDownstreamRequestEvent requestEvent = (HttpServiceDownstreamRequestEvent) responseEvent.getRequest();
        URI uri = getUriFromEvent(requestEvent);
        if (isWithinAWSCall() || isXRaySamplingCall(uri) || isXRayPluginCall(uri)) {
            return;
        }

        Optional<Subsegment> subsegmentOptional = getSubsegmentOptional();
        if (subsegmentOptional.isPresent()) {
            addResponseInformation(subsegmentOptional.get(), responseEvent);
            endSubsegment();
        }
    }