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(prom): Remove MkStreamLabel's associated types #3234

Closed
wants to merge 1 commit into from

Conversation

cratelyn
Copy link
Collaborator

MkStreamLabel is, in short, a generic
(&Request) -> Option<StreamLabel> function. we use it to inspect a request, and potentially provide the caller with an object that can provide relevant labels.

the StreamLabel interface includes associated types for the labels used for metrics related to request/response duration, and counting status codes.

we do not however, actually need to separately define these associated types in the MkStreamLabel contract. instead, we can return a generic StreamLabel of some sort, and leave the responsibility of the (admittedly baroque) uniform function call access to our type aliases like RecordResponseDuration and RecordRequestDuration.

this is a small initial step towards simplifying code that must interact with the MkStreamLabel interface.

cratelyn added a commit that referenced this pull request Sep 25, 2024
`MkStreamLabel` is, in short, a generic
`(&Request) -> Option<StreamLabel>` function. we use it to inspect a
request, and potentially provide the caller with an object that can
provide relevant labels.

the `StreamLabel` interface includes associated types for the labels
used for metrics related to request/response duration, and counting
status codes.

we do not however, actually need to separately define these associated
types in the `MkStreamLabel` contract. instead, we can return a generic
`StreamLabel` of some sort, and leave the responsibility of the
(admittedly baroque) uniform function call access to our type aliases
like `RecordResponseDuration` and `RecordRequestDuration`.

this is a small initial step towards simplifying code that must interact
with the `MkStreamLabel` interface.

Signed-off-by: katelyn martin <[email protected]>
@cratelyn cratelyn force-pushed the kate/remove-mk-stream-label-associated-types branch from dd4cdb1 to 6711464 Compare September 25, 2024 15:54
@cratelyn

This comment was marked as resolved.

cratelyn added a commit that referenced this pull request Sep 25, 2024
`MkStreamLabel` is, in short, a generic
`(&Request) -> Option<StreamLabel>` function. we use it to inspect a
request, and potentially provide the caller with an object that can
provide relevant labels.

the `StreamLabel` interface includes associated types for the labels
used for metrics related to request/response duration, and counting
status codes.

we do not however, actually need to separately define these associated
types in the `MkStreamLabel` contract. instead, we can return a generic
`StreamLabel` of some sort, and leave the responsibility of the
(admittedly baroque) associated type access to our type aliases
like `RecordResponseDuration` and `RecordRequestDuration`.

this change has a pleasant knock-on effect of leaving a number of the
labels submodule's type aliases unused. this commit accordingly removes
aliases like `HttpRouteRsp`, `GrpcRouteRsp`, `HttpRouteBackendRsp`, and
`GrpcRouteBackendRsp`.

this is a small initial step towards simplifying code that must interact
with the `MkStreamLabel` interface.

Signed-off-by: katelyn martin <[email protected]>
@cratelyn cratelyn force-pushed the kate/remove-mk-stream-label-associated-types branch from 6711464 to bc869ff Compare September 25, 2024 16:25
`MkStreamLabel` is, in short, a generic
`(&Request) -> Option<StreamLabel>` function. we use it to inspect a
request, and potentially provide the caller with an object that can
provide relevant labels.

the `StreamLabel` interface includes associated types for the labels
used for metrics related to request/response duration, and counting
status codes.

we do not however, actually need to separately define these associated
types in the `MkStreamLabel` contract. instead, we can return a generic
`StreamLabel` of some sort, and leave the responsibility of the
(admittedly baroque) associated type access to our type aliases
like `RecordResponseDuration` and `RecordRequestDuration`.

this change has a pleasant knock-on effect of leaving a number of the
labels submodule's type aliases unused. this commit accordingly removes
aliases like `HttpRouteRsp`, `GrpcRouteRsp`, `HttpRouteBackendRsp`, and
`GrpcRouteBackendRsp`.

this is a small initial step towards simplifying code that must interact
with the `MkStreamLabel` interface.

Signed-off-by: katelyn martin <[email protected]>
@cratelyn cratelyn force-pushed the kate/remove-mk-stream-label-associated-types branch from bc869ff to ca8c3fb Compare September 25, 2024 16:25
@cratelyn cratelyn marked this pull request as ready for review September 25, 2024 16:38
@cratelyn cratelyn requested a review from a team as a code owner September 25, 2024 16:38
@cratelyn cratelyn self-assigned this Sep 25, 2024
@cratelyn cratelyn marked this pull request as draft September 26, 2024 17:46
cratelyn added a commit that referenced this pull request Sep 27, 2024
`MkStreamLabel` is, in short, a generic
`(&Request) -> Option<StreamLabel>` function. we use it to inspect a
request, and potentially provide the caller with an object that can
provide relevant labels.

the `StreamLabel` interface includes associated types for the labels
used for metrics related to request/response duration, and counting
status codes.

we do not however, actually need to separately define these associated
types in the `MkStreamLabel` contract. instead, we can return a generic
`StreamLabel` of some sort, and leave the responsibility of the
(admittedly baroque) associated type access to our type aliases
like `RecordResponseDuration` and `RecordRequestDuration`.

this change has a pleasant knock-on effect of leaving a number of the
labels submodule's type aliases unused. this commit accordingly removes
aliases like `HttpRouteRsp`, `GrpcRouteRsp`, `HttpRouteBackendRsp`, and
`GrpcRouteBackendRsp`.

this is a small initial step towards simplifying code that must interact
with the `MkStreamLabel` interface.

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

closing in favor of #3242 🔜 🚧

@cratelyn cratelyn closed this Sep 30, 2024
cratelyn added a commit that referenced this pull request Sep 30, 2024
`MkStreamLabel` is, in short, a generic
`(&Request) -> Option<StreamLabel>` function. we use it to inspect a
request, and potentially provide the caller with an object that can
provide relevant labels.

the `StreamLabel` interface includes associated types for the labels
used for metrics related to request/response duration, and counting
status codes.

we do not however, actually need to separately define these associated
types in the `MkStreamLabel` contract. instead, we can return a generic
`StreamLabel` of some sort, and leave the responsibility of the
(admittedly baroque) associated type access to our type aliases
like `RecordResponseDuration` and `RecordRequestDuration`.

this change has a pleasant knock-on effect of leaving a number of the
labels submodule's type aliases unused. this commit accordingly removes
aliases like `HttpRouteRsp`, `GrpcRouteRsp`, `HttpRouteBackendRsp`, and
`GrpcRouteBackendRsp`.

this is a small initial step towards simplifying code that must interact
with the `MkStreamLabel` interface.

Signed-off-by: katelyn martin <[email protected]>
cratelyn added a commit that referenced this pull request Sep 30, 2024
`MkStreamLabel` is, in short, a generic
`(&Request) -> Option<StreamLabel>` function. we use it to inspect a
request, and potentially provide the caller with an object that can
provide relevant labels.

the `StreamLabel` interface includes associated types for the labels
used for metrics related to request/response duration, and counting
status codes.

we do not however, actually need to separately define these associated
types in the `MkStreamLabel` contract. instead, we can return a generic
`StreamLabel` of some sort, and leave the responsibility of the
(admittedly baroque) associated type access to our type aliases
like `RecordResponseDuration` and `RecordRequestDuration`.

this change has a pleasant knock-on effect of leaving a number of the
labels submodule's type aliases unused. this commit accordingly removes
aliases like `HttpRouteRsp`, `GrpcRouteRsp`, `HttpRouteBackendRsp`, and
`GrpcRouteBackendRsp`.

this is a small initial step towards simplifying code that must interact
with the `MkStreamLabel` interface.

Signed-off-by: katelyn martin <[email protected]>
cratelyn added a commit that referenced this pull request Oct 1, 2024
`MkStreamLabel` is, in short, a generic
`(&Request) -> Option<StreamLabel>` function. we use it to inspect a
request, and potentially provide the caller with an object that can
provide relevant labels.

the `StreamLabel` interface includes associated types for the labels
used for metrics related to request/response duration, and counting
status codes.

we do not however, actually need to separately define these associated
types in the `MkStreamLabel` contract. instead, we can return a generic
`StreamLabel` of some sort, and leave the responsibility of the
(admittedly baroque) associated type access to our type aliases
like `RecordResponseDuration` and `RecordRequestDuration`.

this change has a pleasant knock-on effect of leaving a number of the
labels submodule's type aliases unused. this commit accordingly removes
aliases like `HttpRouteRsp`, `GrpcRouteRsp`, `HttpRouteBackendRsp`, and
`GrpcRouteBackendRsp`.

this is a small initial step towards simplifying code that must interact
with the `MkStreamLabel` interface.

Signed-off-by: katelyn martin <[email protected]>
cratelyn added a commit that referenced this pull request Oct 1, 2024
`MkStreamLabel` is, in short, a generic
`(&Request) -> Option<StreamLabel>` function. we use it to inspect a
request, and potentially provide the caller with an object that can
provide relevant labels.

the `StreamLabel` interface includes associated types for the labels
used for metrics related to request/response duration, and counting
status codes.

we do not however, actually need to separately define these associated
types in the `MkStreamLabel` contract. instead, we can return a generic
`StreamLabel` of some sort, and leave the responsibility of the
(admittedly baroque) associated type access to our type aliases
like `RecordResponseDuration` and `RecordRequestDuration`.

this change has a pleasant knock-on effect of leaving a number of the
labels submodule's type aliases unused. this commit accordingly removes
aliases like `HttpRouteRsp`, `GrpcRouteRsp`, `HttpRouteBackendRsp`, and
`GrpcRouteBackendRsp`.

this is a small initial step towards simplifying code that must interact
with the `MkStreamLabel` interface.

Signed-off-by: katelyn martin <[email protected]>
cratelyn added a commit that referenced this pull request Oct 1, 2024
`MkStreamLabel` is, in short, a generic
`(&Request) -> Option<StreamLabel>` function. we use it to inspect a
request, and potentially provide the caller with an object that can
provide relevant labels.

the `StreamLabel` interface includes associated types for the labels
used for metrics related to request/response duration, and counting
status codes.

we do not however, actually need to separately define these associated
types in the `MkStreamLabel` contract. instead, we can return a generic
`StreamLabel` of some sort, and leave the responsibility of the
(admittedly baroque) associated type access to our type aliases
like `RecordResponseDuration` and `RecordRequestDuration`.

this change has a pleasant knock-on effect of leaving a number of the
labels submodule's type aliases unused. this commit accordingly removes
aliases like `HttpRouteRsp`, `GrpcRouteRsp`, `HttpRouteBackendRsp`, and
`GrpcRouteBackendRsp`.

this is a small initial step towards simplifying code that must interact
with the `MkStreamLabel` interface.

Signed-off-by: katelyn martin <[email protected]>
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.

1 participant