feat(http/prom): introduce StreamLabel components#4251
Merged
Conversation
aac9f88 to
c8d28a6
Compare
StreamLabel components
This was referenced Oct 17, 2025
olix0r
approved these changes
Nov 5, 2025
this commit introduces a collection of `MkStreamLabel` and `StreamLabel` implementations that can be used to inspect status codes for HTTP and gRPC traffic. these do not emit duration labels, but can be used by other implementors of these traits to perform the common logic of checking HTTP status codes in response front matter, and for inspecting body trailers in gRPC traffic. Signed-off-by: katelyn martin <kate@buoyant.io>
this commit introduces a `LabelError<E>` type, which provides a `StreamLabel` implementation that maps boxed errors to labels. this is generic across `E`-typed labels that can be constructed `From` a reference to a boxed `linkerd_error::Error`. Signed-off-by: katelyn martin <kate@buoyant.io>
this commit introduces a simple "identity" implementation of `MkStreamLabel` and `StreamLabel`. this is useful for metrics such as our duration recording histogram, that do not inspect the request, response, or outcome for further labels. Signed-off-by: katelyn martin <kate@buoyant.io>
3683a66 to
771854a
Compare
cratelyn
added a commit
that referenced
this pull request
Nov 5, 2025
**nb:** this branch is based upon #4250 and #4251. this branch re-frames the outbound proxy's stream labeling facilities in terms of the constituent status and error labeling facilities introduced to the `linkerd-http-prom` library in #4251. * feat(app/outbound): convenience constructors for `HttpRsp`, `GrpcRsp` Signed-off-by: katelyn martin <kate@buoyant.io> * feat(app/outbound): `GrpcRsp`, `HttpRsp` are `From<&Error>` Signed-off-by: katelyn martin <kate@buoyant.io> * feat(app/outbound): `GrpcRsp` and `HttpRsp` can be merged this commit introduces `apply()` methods to `HttpRsp` and `GrpcRsp`. this allows us to collect both the response status and response error when a body encounters an error whilst polling. Signed-off-by: katelyn martin <kate@buoyant.io> * refactor(app/outbound): `LabelHttpRsp` uses `LabelHttpStatus` Signed-off-by: katelyn martin <kate@buoyant.io> * refactor(app/outbound): `LabelGrpcRsp` uses `LabelGrpcStatus` Signed-off-by: katelyn martin <kate@buoyant.io> --------- Signed-off-by: katelyn martin <kate@buoyant.io>
cratelyn
added a commit
that referenced
this pull request
Feb 9, 2026
#4251 introduced a suite of MkStreamLabel components that can be used to inspect and label traffic. MkWithLabels offers a way to construct this type externally, now that we will have use for it in the inbound proxy. Signed-off-by: katelyn martin <kate@buoyant.io>
cratelyn
added a commit
that referenced
this pull request
Feb 10, 2026
#4251 introduced a suite of MkStreamLabel components that can be used to inspect and label traffic. MkWithLabels offers a way to construct this type externally, now that we will have use for it in the inbound proxy. Signed-off-by: katelyn martin <kate@buoyant.io>
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.
nb: this branch is based upon #4250.
feat(http/prom): add http and grpc status labelers
this commit introduces a collection of
MkStreamLabelandStreamLabelimplementations that can be used to inspect status codes for HTTP and
gRPC traffic.
these do not emit duration labels, but can be used by other
implementors of these traits to perform the common logic of checking
HTTP status codes in response front matter, and for inspecting body
trailers in gRPC traffic.
feat(http/prom): add an error labeler
this commit introduces a
LabelError<E>type, which provides aStreamLabelimplementation that maps boxed errors to labels.this is generic across
E-typed labels that can be constructedFromareference to a boxed
linkerd_error::Error.feat(http/prom): add an identity labeler
this commit introduces a simple "identity" implementation of
MkStreamLabelandStreamLabel.this is useful for metrics such as our duration recording histogram,
that do not inspect the request, response, or outcome for further
labels.