Repository navigation
refactor(app/core): remove EncodeLabelSetMut - #4588
Merged
Merged
Conversation
in #4587, we upgraded our dependency upon kubert to a new 0.26.0 release. as part of this, our dependency upon the prometheus sdk was also upgraded from 0.23 to 0.24. version 0.24.0 included some exciting upstream changes that we drove last year, particularly prometheus/client_rust#257. from that pr: > [this pr] alters the signature of the `EncodeLabelSet::encode()` > trait method, such that it now accepts a mutable reference to its > encoder. > > this change permits distinct label sets to be composed together, now > that the label set encoder is not consumed. a new implementation for > tuples `(A, B)` is provided. we'd been working around this deficiency using an internal trait that _did_ provide our desired trait signature, originally introduced in #2555. https://github.com/linkerd/linkerd2-proxy/pull/2555/changes#diff-36a73a9a9de1e34abac85003560b0aea70e9ebb0f1cc29af3dce703bfbef7a89R47-R49 now that we've upgraded to a more recent `prometheus_client` version, this trait is no longer needed, and all of the glue connecting `EncodeLabelSet` to our applicative labels via `EncodeLabelSetMut` can be removed. no code is changed. function bodies are moved from `linkerd_app_core::metrics::prom::EncodeLabelSetMut::encode_label_set()` to `prometheus_client::encoding::EncodeLabelSet::encode()`. invocations of the former are replaced with the latter where applicable. Signed-off-by: katelyn martin <kate@buoyant.io>
zaharidichev
approved these changes
Jul 10, 2026
zaharidichev
left a comment
Member
There was a problem hiding this comment.
This is great simplification! Was not aware this is in the works. 🎉
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.
in #4587, we upgraded our dependency upon kubert
to a new 0.26.0 release. as part of this, our dependency upon the
prometheus sdk was also upgraded from 0.23 to 0.24.
version 0.24.0 included some exciting upstream changes that we drove
last year, particularly prometheus/client_rust#257. from that pr:
we'd been working around this deficiency using an internal trait that
did provide our desired trait signature, originally introduced in
#2555.
https://github.com/linkerd/linkerd2-proxy/pull/2555/changes#diff-36a73a9a9de1e34abac85003560b0aea70e9ebb0f1cc29af3dce703bfbef7a89R47-R49
now that we've upgraded to a more recent
prometheus_clientversion,this trait is no longer needed, and all of the glue connecting
EncodeLabelSetto our applicative labels viaEncodeLabelSetMutcanbe removed.
no code is changed. function bodies are moved from
linkerd_app_core::metrics::prom::EncodeLabelSetMut::encode_label_set()to
prometheus_client::encoding::EncodeLabelSet::encode(). invocationsof the former are replaced with the latter where applicable.
Signed-off-by: katelyn martin kate@buoyant.io