Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(app): Simplify backend metrics tower layer #3318

Open
wants to merge 2 commits into
base: kate/record-body-data
Choose a base branch
from

Conversation

cratelyn
Copy link
Collaborator

@cratelyn cratelyn commented Nov 4, 2024

nb: this is based on #3308. this is a refactor branch aimed at finding a way to simplify the somewhat burdensome types in the metrics middleware's layer(..) function.

refactor(app): Define layer type aliases

this isn't a "simplification" so much as an outlining of the chunky types in this function signature.

that said... it's subjectively nice to outline the definition of our layers into a MetricsLayer<T, N>
that we can use as shorthand in the function signature of layer(..).

refactor(app): Simplify backend metrics layer bounds

this commit changes the backend-level metrics layer function, so that it invokes
linkerd_app_core::svc::layers() rather than linkerd_app_core::svc::layer::mk().

this has a nice effect in that it simplifies the bounds of the layer function.

@cratelyn cratelyn self-assigned this Nov 4, 2024
@cratelyn cratelyn changed the title refactor(app): simplify backend metrics tower layer refactor(app): Simplify backend metrics tower layer Nov 4, 2024
@cratelyn cratelyn marked this pull request as ready for review November 4, 2024 17:35
@cratelyn cratelyn requested a review from a team as a code owner November 4, 2024 17:35
this commit changes the backend-level metrics layer function, so that it
invokes `linkerd_app_core::svc::layers()` rather than
`linkerd_app_core::svc::layer::mk()`.

this has a nice effect in that it simplifies the bounds of the `layer`
function.

Signed-off-by: katelyn martin <[email protected]>
this isn't a "simplification" so much as an outlining of the chunky
types in this function signature.

that said... it's subjectively nice to outline the definition of our
layers into a `MetricsLayer<T, N>` that we can use as shorthand in the
function signature of `layer(..)`.

Signed-off-by: katelyn martin <[email protected]>
@cratelyn
Copy link
Collaborator Author

this pr has been rebased onto main as of release v2.263.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants