gpt4 book ai didi

envoyproxy - 各种Envoy RESPONSE_FLAGS的原因是什么

转载 作者:行者123 更新时间:2023-12-04 11:33:42 24 4
gpt4 key购买 nike

我正在尝试调试服务网格,Envoy 位于中间。访问日志显示了很多 503,它们的 %RESPONSE_FLAGS% 各不相同。 .除了 the access logging docs ,我找不到关于标志实际含义的任何解释。
例如,精辟地,NR意思是“我向下游发送了 404,但不是因为上游向我发送了一个,而是因为我没有匹配的路由,所以我,特使生成了 404”。我会喜欢像这样的单衬线用于其他一些。特别是我在苦苦挣扎(这些都出现在我们的日志中......)

  • UR对比 UC - 我认为这些是“我向下游发送了 503,因为我连接了上游,但随后出现了问题”。什么问题?具体怎么做remote reset对比 connection termination意思?
  • LR connection local reset - 这是什么意思?特使向下游发送了 503,因为它决定停止与上游对话,中途?为什么会那样做?
  • <no flag> - 我是否正确地假设如果有像 404 这样的错误代码或 503没有 RESPONSE_FLAGS ,那个代码是由上游发送的,只是被转发了?
  • 最佳答案

    从下面的源代码,

  • UR: UPSTREAM_REMOTE_RESET 如果在流上收到远程编解码器级别重置。
  • UC: UPSTREAM_CONNECTION_TERMINATION 如果流因连接终止而在本地重置。
  • LR:如果在流上发送了本地编解码器级别重置
  • /**
    * Stream reset reasons.
    */
    enum class StreamResetReason { // If a local codec level reset was sent on the stream.
    LocalReset,
    // If a local codec level refused stream reset was sent on the stream (allowing for retry).
    LocalRefusedStreamReset,
    // If a remote codec level reset was received on the stream.
    RemoteReset,
    // If a remote codec level refused stream reset was received on the stream (allowing for retry).
    RemoteRefusedStreamReset,
    // If the stream was locally reset by a connection pool due to an initial connection failure.
    ConnectionFailure,
    // If the stream was locally reset due to connection termination.
    ConnectionTermination,
    // The stream was reset because of a resource overflow.
    Overflow,
    // Either there was an early TCP error for a CONNECT request or the peer reset with CONNECT_ERROR
    ConnectError,
    // Received payload did not conform to HTTP protocol.
    ProtocolError
    };

    StreamInfo::ResponseFlag
    Filter::streamResetReasonToResponseFlag(Http::StreamResetReason reset_reason) { switch (reset_reason) {
    case Http::StreamResetReason::ConnectionFailure: return StreamInfo::ResponseFlag::UpstreamConnectionFailure;
    case Http::StreamResetReason::ConnectionTermination:
    return StreamInfo::ResponseFlag::UpstreamConnectionTermination;
    case Http::StreamResetReason::LocalReset:
    case Http::StreamResetReason::LocalRefusedStreamReset:
    return StreamInfo::ResponseFlag::LocalReset;
    case Http::StreamResetReason::Overflow:
    return StreamInfo::ResponseFlag::UpstreamOverflow;
    case Http::StreamResetReason::RemoteReset:
    case Http::StreamResetReason::RemoteRefusedStreamReset:
    case Http::StreamResetReason::ConnectError:
    return StreamInfo::ResponseFlag::UpstreamRemoteReset;
    case Http::StreamResetReason::ProtocolError:
    return StreamInfo::ResponseFlag::UpstreamProtocolError;
    }

    NOT_REACHED_GCOVR_EXCL_LINE;
    }

    constexpr static absl::string_view NONE = "-"; constexpr static absl::string_view DOWNSTREAM_CONNECTION_TERMINATION = "DC"; constexpr static absl::string_view FAILED_LOCAL_HEALTH_CHECK = "LH"; constexpr static absl::string_view NO_HEALTHY_UPSTREAM = "UH"; constexpr static absl::string_view UPSTREAM_REQUEST_TIMEOUT = "UT"; constexpr static absl::string_view LOCAL_RESET = "LR"; constexpr static absl::string_view UPSTREAM_REMOTE_RESET = "UR"; constexpr static absl::string_view UPSTREAM_CONNECTION_FAILURE = "UF"; constexpr static absl::string_view UPSTREAM_CONNECTION_TERMINATION = "UC"; constexpr static absl::string_view UPSTREAM_OVERFLOW = "UO"; constexpr static absl::string_view UPSTREAM_RETRY_LIMIT_EXCEEDED = "URX"; constexpr static absl::string_view NO_ROUTE_FOUND = "NR"; constexpr static absl::string_view DELAY_INJECTED = "DI"; constexpr static absl::string_view FAULT_INJECTED = "FI"; constexpr static absl::string_view RATE_LIMITED = "RL"; constexpr static absl::string_view UNAUTHORIZED_EXTERNAL_SERVICE = "UAEX"; constexpr static absl::string_view RATELIMIT_SERVICE_ERROR = "RLSE"; constexpr static absl::string_view STREAM_IDLE_TIMEOUT = "SI"; constexpr static absl::string_view INVALID_ENVOY_REQUEST_HEADERS = "IH"; constexpr static absl::string_view DOWNSTREAM_PROTOCOL_ERROR = "DPE"; constexpr static absl::string_view UPSTREAM_MAX_STREAM_DURATION_REACHED = "UMSDR"; constexpr static absl::string_view RESPONSE_FROM_CACHE_FILTER = "RFCF"; constexpr static absl::string_view NO_FILTER_CONFIG_FOUND = "NFCF"; constexpr static absl::string_view DURATION_TIMEOUT = "DT"; constexpr static absl::string_view UPSTREAM_PROTOCOL_ERROR = "UPE"; constexpr static absl::string_view NO_CLUSTER_FOUND = "NC"; static constexpr std::array ALL_RESPONSE_STRING_FLAGS{ FlagStringAndEnum{FAILED_LOCAL_HEALTH_CHECK, ResponseFlag::FailedLocalHealthCheck}, FlagStringAndEnum{NO_HEALTHY_UPSTREAM, ResponseFlag::NoHealthyUpstream}, FlagStringAndEnum{UPSTREAM_REQUEST_TIMEOUT, ResponseFlag::UpstreamRequestTimeout}, FlagStringAndEnum{LOCAL_RESET, ResponseFlag::LocalReset}, FlagStringAndEnum{UPSTREAM_REMOTE_RESET, ResponseFlag::UpstreamRemoteReset}, FlagStringAndEnum{UPSTREAM_CONNECTION_FAILURE, ResponseFlag::UpstreamConnectionFailure}, FlagStringAndEnum{UPSTREAM_CONNECTION_TERMINATION, ResponseFlag::UpstreamConnectionTermination}, FlagStringAndEnum{UPSTREAM_OVERFLOW, ResponseFlag::UpstreamOverflow}, FlagStringAndEnum{NO_ROUTE_FOUND, ResponseFlag::NoRouteFound}, FlagStringAndEnum{DELAY_INJECTED, ResponseFlag::DelayInjected}, FlagStringAndEnum{FAULT_INJECTED, ResponseFlag::FaultInjected}, FlagStringAndEnum{RATE_LIMITED, ResponseFlag::RateLimited}, FlagStringAndEnum{UNAUTHORIZED_EXTERNAL_SERVICE, ResponseFlag::UnauthorizedExternalService}, FlagStringAndEnum{RATELIMIT_SERVICE_ERROR, ResponseFlag::RateLimitServiceError}, FlagStringAndEnum{DOWNSTREAM_CONNECTION_TERMINATION, ResponseFlag::DownstreamConnectionTermination}, FlagStringAndEnum{UPSTREAM_RETRY_LIMIT_EXCEEDED, ResponseFlag::UpstreamRetryLimitExceeded}, FlagStringAndEnum{STREAM_IDLE_TIMEOUT, ResponseFlag::StreamIdleTimeout}, FlagStringAndEnum{INVALID_ENVOY_REQUEST_HEADERS, ResponseFlag::InvalidEnvoyRequestHeaders}, FlagStringAndEnum{DOWNSTREAM_PROTOCOL_ERROR, ResponseFlag::DownstreamProtocolError}, FlagStringAndEnum{UPSTREAM_MAX_STREAM_DURATION_REACHED, ResponseFlag::UpstreamMaxStreamDurationReached}, FlagStringAndEnum{RESPONSE_FROM_CACHE_FILTER, ResponseFlag::ResponseFromCacheFilter}, FlagStringAndEnum{NO_FILTER_CONFIG_FOUND, ResponseFlag::NoFilterConfigFound}, FlagStringAndEnum{DURATION_TIMEOUT, ResponseFlag::DurationTimeout}, FlagStringAndEnum{UPSTREAM_PROTOCOL_ERROR, ResponseFlag::UpstreamProtocolError}, FlagStringAndEnum{NO_CLUSTER_FOUND, ResponseFlag::NoClusterFound}, };

    关于envoyproxy - 各种Envoy RESPONSE_FLAGS的原因是什么,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64824023/

    24 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com