Skip to content

Add outlier detection failure matcher#3741

Merged
istio-testing merged 8 commits into
istio:masterfrom
Samarth6840:add-outlier-detection-failure-matcher
Jul 21, 2026
Merged

Add outlier detection failure matcher#3741
istio-testing merged 8 commits into
istio:masterfrom
Samarth6840:add-outlier-detection-failure-matcher

Conversation

@Samarth6840

Copy link
Copy Markdown
Contributor

What this PR does

Adds outlier_detection_http_error_codes to OutlierDetection in DestinationRule,
allowing users to specify additional HTTP status codes (beyond the default 5xx) to
be treated as outlier detection failures.

Maps to Envoy's new outlier_detection.failure_matcher in HttpProtocolOptions
(envoyproxy/envoy#39947).

Follows the same simplification pattern as consecutiveGatewayErrors /
consecutive5xxErrors (#1189) — a plain repeated field rather than exposing
Envoy's raw MatchPredicate, consistent with Istio's existing approach (e.g.
VirtualService's retryOn).

Related

Implements the API portion of istio/istio#60828

Next steps

Wiring into istio/istio's cluster_traffic_policy.go (HttpProtocolOptions
section) will follow in a separate PR.

@Samarth6840
Samarth6840 requested a review from a team as a code owner July 11, 2026 05:44
@istio-policy-bot

Copy link
Copy Markdown

😊 Welcome @Samarth6840! This is either your first contribution to the Istio api repo, or it's been
a while since you've been here.

You can learn more about the Istio working groups, Code of Conduct, and contribution guidelines
by referring to Contributing to Istio.

Thanks for contributing!

Courtesy of your friendly welcome wagon.

@linux-foundation-easycla

linux-foundation-easycla Bot commented Jul 11, 2026

Copy link
Copy Markdown

CLA Signed
The committers listed above are authorized under a signed CLA.

@istio-testing istio-testing added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. needs-ok-to-test labels Jul 11, 2026
@istio-testing

Copy link
Copy Markdown
Collaborator

Hi @Samarth6840. Thanks for your PR.

I'm waiting for a istio member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work.

Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@Samarth6840
Samarth6840 force-pushed the add-outlier-detection-failure-matcher branch from aa6b8ce to 0ab9dbe Compare July 11, 2026 05:56
@ramaraochavali

Copy link
Copy Markdown
Contributor

/ok-to-test

@istio-testing istio-testing added ok-to-test Set this label allow normal testing to take place for a PR not submitted by an Istio org member. and removed needs-ok-to-test labels Jul 13, 2026
// applicable in k8s environments with few pods per service.
int32 min_health_percent = 5;

// Specifies additional HTTP response status codes that should be treated as

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Samarth6840 : The comment says "in addition to" but Envoy's error_matcher is an override, could you please fix the comment to reflect that ? You can find the exact behavior at https://www.envoyproxy.io/docs/envoy/latest/api-v3/extensions/upstreams/http/v3/http_protocol_options.proto#extensions-upstreams-http-v3-httpprotocoloptions-outlierdetection

@kfaseela kfaseela added the release-notes-none Indicates a PR that does not require release notes. label Jul 15, 2026
@kfaseela

Copy link
Copy Markdown
Member

/test release-notes

@kfaseela

Copy link
Copy Markdown
Member

@ramaraochavali : This API looks good to me, may be in future we can have some MeshConfig level defaults as well, but this does not have to be blocked. I have also pushed the implementation PR. Could you please approve the API if it looks good?

kfaseela added a commit to Nordix/istio that referenced this pull request Jul 15, 2026
…tinationRule

    Wires outlierDetectionHttpErrorCodes from DestinationRule.OutlierDetection
    into Envoy's HttpProtocolOptions.OutlierDetection.error_matcher.

    API: istio/api#3741
    Resolves: istio#60828

Signed-off-by: Faseela K <faseela.k@est.tech>
int32 min_health_percent = 5;

// Specifies HTTP response status codes that should be treated as
// outlier detection errors. Overrides the default 5xx behavior.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This and next statement are contradicting to each other? when you specify this field and consecutive5xxErrors both - I assume both put together are treated as outliers?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ramaraochavali : Could you please take a look if the updates description looks clearer?

Comment thread networking/v1alpha3/destination_rule.proto Outdated
// Specifies the HTTP response status codes that are treated as outlier
// detection errors. If specified, only responses with one of these status
// codes will be treated as errors by outlier detection. If not specified,
// only 5xx responses are treated as errors.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the outliers are detected based on consecutive5xx and consecutiveGatewayErrors fields.

Comment on lines +867 to +877

// Specifies the HTTP response status codes that are treated as outlier
// detection errors. If specified, only responses with one of these status
// codes will be treated as errors by outlier detection. If not specified,
// only 5xx responses are treated as errors.
//
// Values must be in the range [100, 599].
//
// +protoc-gen-crd:list-value-validation:Minimum=100
// +protoc-gen-crd:list-value-validation:Maximum=599
repeated uint32 outlier_detection_http_error_codes = 10;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// Specifies the HTTP response status codes that are treated as outlier
// detection errors. If specified, only responses with one of these status
// codes will be treated as errors by outlier detection. If not specified,
// only 5xx responses are treated as errors.
//
// Values must be in the range [100, 599].
//
// +protoc-gen-crd:list-value-validation:Minimum=100
// +protoc-gen-crd:list-value-validation:Maximum=599
repeated uint32 outlier_detection_http_error_codes = 10;
// Specifies the HTTP response status codes that are treated as outlier
// detection errors. If specified, only responses with one of these status
// codes will be treated as errors by outlier detection. If not specified,
// only 5xx responses are treated as errors.
//
// Note: Host ejection is still driven by the `consecutive5xxErrors` and
// `consecutiveGatewayErrors` thresholds; this field only redefines which
// HTTP status codes are counted as errors toward those thresholds.
//
// Values must be in the range [100, 599].
//
// +protoc-gen-crd:list-value-validation:Minimum=100
// +protoc-gen-crd:list-value-validation:Maximum=599
repeated uint32 outlier_detection_http_error_codes = 10;

@kfaseela

Copy link
Copy Markdown
Member

@Samarth6840 : please use the updated description I have given , and also run make gen.

@istio-testing
istio-testing merged commit b8f8791 into istio:master Jul 21, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ok-to-test Set this label allow normal testing to take place for a PR not submitted by an Istio org member. release-notes-none Indicates a PR that does not require release notes. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants