public ObjectNode toJsonNode() {
        ObjectNode root = JACKSON_MAPPER.createObjectNode();
        root.put("status", status);
        root.put("duration", duration);
        root.put("attempt", attempt);

        putNullableAttribute(root, "error", error);
        putNullableAttribute(root, "cause", cause);
        putNullableAttribute(root, "exceptionType", exceptionType);
        putNullableAttribute(root, "region", region);
        putNullableAttribute(root, "availabilityZone", availabilityZone);
        putNullableAttribute(root, "asg", asg);
        putNullableAttribute(root, "instanceId", instanceId);
        putNullableAttribute(root, "vip", vip);
        putNullableAttribute(root, "ipAddress", ipAddress);

        if (port > 0) {
            root.put("port", port);
        }

        if (status < 1) {
            root.put("readTimeout", readTimeout);
            root.put("connectTimeout", connectTimeout);
        }

        return root;
    }
User: michaels@netflix.com
Date: 9/2/14
Time: 2:52 PM
zuul-core/src/main/java/com/netflix/zuul/niws/RequestAttempt.java