Conversation
ecaaf39 changed the proxy's behavior with regard to creating [default response classifiers][default]: the defaults used to support detecting gRPC response (regardless of the request properties). To fix this, we modify the metrics module that uses responses classifiers to *require* them without inferring defaults. This enforces the intended usage pattern so that we do not silently and implicitly fall back to the default behavior. This change also updates the `NewClassify` module that inserts the response classifier request extension so that overrides are supported. We then can install a default classifier early in request processing and override it only if specified by a route configuration. To support this change, the http-metrics crate is updated to support querying response_total metrics without stringifying everything. [default]: ecaaf39#diff-372e8a8a57b1fad5d94f37d2f77fdc7a45bcf708782475424b75d671f99ea1a0L97-L103
hawkw
approved these changes
Nov 1, 2023
Contributor
hawkw
left a comment
There was a problem hiding this comment.
this change looks good to me! good call on including debug assertions to help catch regressions in the tests but not take down the whole proxy in prod!
Comment on lines
+70
to
+71
| if req.extensions_mut().insert(classify_rsp).is_some() { | ||
| tracing::debug!("Overrode response classifier"); |
Contributor
There was a problem hiding this comment.
nit, take it or leave it: maybe worth having this print what the previous classifier was?
Suggested change
| if req.extensions_mut().insert(classify_rsp).is_some() { | |
| tracing::debug!("Overrode response classifier"); | |
| if let Some(prev) = req.extensions_mut().insert(classify_rsp) { | |
| tracing::debug!(?prev, "Overrode response classifier"); |
Member
Author
There was a problem hiding this comment.
that requires adding Debug bounds which felt a little larger than desired.
olix0r
added a commit
to linkerd/linkerd2
that referenced
this pull request
Nov 2, 2023
This release includes several bugfixes. Notably, inbound proxies would not properly reflect grpc-status in metrics by default. Furthermore, proxies now long warnings when they receive unexpected error responses from the control plane. --- * chore: change `rust-toolchain` file to toml format (linkerd/linkerd2-proxy#2487) * gate: Detect disconnected inner services in readiness (linkerd/linkerd2-proxy#2491) * Bump ahash to v0.8.5 (linkerd/linkerd2-proxy#2498) * gate: Fix readiness deadlock (linkerd/linkerd2-proxy#2493) * Log a warning when the controller clients receive an error (linkerd/linkerd2-proxy#2499) * inbound: Fix gRPC response classification (linkerd/linkerd2-proxy#2496) Signed-off-by: Oliver Gould <[email protected]>
olix0r
added a commit
to linkerd/linkerd2
that referenced
this pull request
Nov 2, 2023
This release includes several bugfixes. Notably, inbound proxies would not properly reflect grpc-status in metrics by default. Furthermore, proxies now long warnings when they receive unexpected error responses from the control plane. --- * chore: change `rust-toolchain` file to toml format (linkerd/linkerd2-proxy#2487) * gate: Detect disconnected inner services in readiness (linkerd/linkerd2-proxy#2491) * Bump ahash to v0.8.5 (linkerd/linkerd2-proxy#2498) * gate: Fix readiness deadlock (linkerd/linkerd2-proxy#2493) * Log a warning when the controller clients receive an error (linkerd/linkerd2-proxy#2499) * inbound: Fix gRPC response classification (linkerd/linkerd2-proxy#2496) Signed-off-by: Oliver Gould <[email protected]>
adleong
pushed a commit
that referenced
this pull request
Nov 16, 2023
ecaaf39 changed the proxy's behavior with regard to creating [default response classifiers][default]: the defaults used to support detecting gRPC response (regardless of the request properties). To fix this, we modify the metrics module that uses responses classifiers to *require* them without inferring defaults. This enforces the intended usage pattern so that we do not silently and implicitly fall back to the default behavior. This change also updates the `NewClassify` module that inserts the response classifier request extension so that overrides are supported. We then can install a default classifier early in request processing and override it only if specified by a route configuration. To support this change, the http-metrics crate is updated to support querying response_total metrics without stringifying everything. [default]: ecaaf39#diff-372e8a8a57b1fad5d94f37d2f77fdc7a45bcf708782475424b75d671f99ea1a0L97-L103
Merged
adleong
added a commit
that referenced
this pull request
Nov 16, 2023
* Include server address in server error logs (#2500) * inbound: Fix gRPC response classification (#2496) * Bump ahash to v0.8.5 (#2498) * Allow BSD-2-Clause --------- Co-authored-by: Oliver Gould <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ecaaf39 changed the proxy's behavior with regard to creating default response classifiers: the defaults used to support detecting gRPC response (regardless of the request properties).
To fix this, we modify the metrics module that uses responses classifiers to require them without inferring defaults. This enforces the intended usage pattern so that we do not silently and implicitly fall back to the default behavior. This requirement is only strictly enforced in development builds. In release builds, the prior defaulting behavior remains in place. This minimizes the difference from the existing behavior, especially if we hit untested cases where a hard failure would be untenable (especially in metrics code).
This change also updates the
NewClassifymodule that inserts the response classifier request extension so that overrides are supported. We then can install a default classifier early in request processing and override it only if specified by a route configuration.To support this change, the http-metrics crate is updated to support querying response_total metrics without stringifying everything.