-
Notifications
You must be signed in to change notification settings - Fork 271
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): Outline route label extractor #3337
Conversation
bb26e1e
to
2d8d0f2
Compare
### ⛅ overview this introduces a new tower middleware for Prometheus metrics, used for instrumenting HTTP and gRPC request bodies, and observing (a) the number of frames yielded by a body, and (b) the number of bytes included in body frames. this builds upon the backend-level metrics added in #3308. this additionally uses the route label extractor, hoisted out of the retry middleware's Prometheus telemetry in #3337. ### 📝 changes * a `linkerd_http_prom::body_data::request::NewRecordBodyData::NewRecordBodyData` middleware is added, which complements the equivalent `linkerd_http_prom::body_data::response` middleware. * this is added Signed-off-by: katelyn martin <[email protected]>
cd2d1b9
to
3b1db24
Compare
2d8d0f2
to
a75492c
Compare
### ⛅ overview this introduces a new tower middleware for Prometheus metrics, used for instrumenting HTTP and gRPC request bodies, and observing (a) the number of frames yielded by a body, and (b) the number of bytes included in body frames. this builds upon the backend-level metrics added in #3308. this additionally uses the route label extractor, hoisted out of the retry middleware's Prometheus telemetry in #3337. ### 📝 changes * a `linkerd_http_prom::body_data::request::NewRecordBodyData::NewRecordBodyData` middleware is added, which complements the equivalent `linkerd_http_prom::body_data::response` middleware. * this is added Signed-off-by: katelyn martin <[email protected]>
### ⛅ overview this introduces a new tower middleware for Prometheus metrics, used for instrumenting HTTP and gRPC request bodies, and observing (a) the number of frames yielded by a body, and (b) the number of bytes included in body frames. this builds upon the backend-level metrics added in #3308. this additionally uses the route label extractor, hoisted out of the retry middleware's Prometheus telemetry in #3337. ### 📝 changes * a `linkerd_http_prom::body_data::request::NewRecordBodyData::NewRecordBodyData` middleware is added, which complements the equivalent `linkerd_http_prom::body_data::response` middleware. * this is added to policy routes' metrics layer. Signed-off-by: katelyn martin <[email protected]>
### ⛅ overview this introduces a new tower middleware for Prometheus metrics, used for instrumenting HTTP and gRPC request bodies, and observing (a) the number of frames yielded by a body, and (b) the number of bytes included in body frames. this builds upon the backend-level metrics added in #3308. this additionally uses the route label extractor, hoisted out of the retry middleware's Prometheus telemetry in #3337. ### 📝 changes * a `linkerd_http_prom::body_data::request::NewRecordBodyData::NewRecordBodyData` middleware is added, which complements the equivalent `linkerd_http_prom::body_data::response` middleware. * this is added to policy routes' metrics layer. Signed-off-by: katelyn martin <[email protected]>
this pr has been rebased onto |
process note, while this is a pr based on #3308, i'd like to commit it separately. i'm going to refrain from merging this until the underlying pr lands. |
95e796f
to
c728e18
Compare
a75492c
to
a84a157
Compare
this pr has been rebased onto |
c728e18
to
33f5f60
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## kate/record-body-data #3337 +/- ##
========================================================
Coverage ? 67.38%
========================================================
Files ? 386
Lines ? 18048
Branches ? 0
========================================================
Hits ? 12161
Misses ? 5887
Partials ? 0
Continue to review full report in Codecov by Sentry.
|
this commit promotes the `RetryLabelExtract` type out of the route retry middleware, and into the metrics submodule. in preparation for generalizing this component, we rename it to `RouteLabelExtract`. Signed-off-by: katelyn martin <[email protected]>
this addresses the `TODO` comment, moving the `RouteLabelExtract` type out of the policy route layer function. this defines a method on `MatchedRoute` which may be called to retrieve a `RouteLabelExtract`. that type holds references to the contruction-time information about the route, and can be used to later inspect an outbound request at call-time, returning a `labels::Route` set of labels. this is a helpful piece of reusable glue that is broadly useful in instrumenting our route-level middleware. Signed-off-by: katelyn martin <[email protected]>
a84a157
to
71cca7f
Compare
rebased on |
set to auto-merge upon ci completing ✔️ |
### ⛅ overview this introduces a new tower middleware for Prometheus metrics, used for instrumenting HTTP and gRPC request bodies, and observing (a) the number of frames yielded by a body, and (b) the number of bytes included in body frames. this builds upon the backend-level metrics added in #3308. this additionally uses the route label extractor, hoisted out of the retry middleware's Prometheus telemetry in #3337. ### 📝 changes * a `linkerd_http_prom::body_data::request::NewRecordBodyData::NewRecordBodyData` middleware is added, which complements the equivalent `linkerd_http_prom::body_data::response` middleware. * this is added to policy routes' metrics layer. Signed-off-by: katelyn martin <[email protected]>
### ⛅ overview this introduces a new tower middleware for Prometheus metrics, used for instrumenting HTTP and gRPC request bodies, and observing (a) the number of frames yielded by a body, (b) the number of bytes included in body frames, and (c) a distribution of the size of frames yielded. this builds upon the backend-level metrics added in #3308. this additionally uses the route label extractor, hoisted out of the retry middleware's Prometheus telemetry in #3337. ### 📝 changes * a `linkerd_http_prom::body_data::request::NewRecordBodyData::NewRecordBodyData` middleware is added, which complements the equivalent `linkerd_http_prom::body_data::response` middleware. * this is added to policy routes' metrics layer. see prometheus/client_rust#241 and prometheus/client_rust#242, which track upstream proposals to add accessors to `Histogram` that will allow us to make test assertions that metrics are working properly. for now, these are feature gated as also done in #3308. Signed-off-by: katelyn martin <[email protected]>
### ⛅ overview this introduces a new tower middleware for Prometheus metrics, used for instrumenting HTTP and gRPC request bodies, and observing (a) the number of frames yielded by a body, (b) the number of bytes included in body frames, and (c) a distribution of the size of frames yielded. this builds upon the backend-level metrics added in #3308. this additionally uses the route label extractor, hoisted out of the retry middleware's Prometheus telemetry in #3337. ### 📝 changes * a `linkerd_http_prom::body_data::request::NewRecordBodyData::NewRecordBodyData` middleware is added, which complements the equivalent `linkerd_http_prom::body_data::response` middleware. * this is added to policy routes' metrics layer. see prometheus/client_rust#241 and prometheus/client_rust#242, which track upstream proposals to add accessors to `Histogram` that will allow us to make test assertions that metrics are working properly. for now, these are feature gated as also done in #3308. Signed-off-by: katelyn martin <[email protected]>
### ⛅ overview this introduces a new tower middleware for Prometheus metrics, used for instrumenting HTTP and gRPC request bodies, and observing (a) the number of frames yielded by a body, (b) the number of bytes included in body frames, and (c) a distribution of the size of frames yielded. this builds upon the backend-level metrics added in #3308. this additionally uses the route label extractor, hoisted out of the retry middleware's Prometheus telemetry in #3337. ### 📝 changes * a `linkerd_http_prom::body_data::request::NewRecordBodyData::NewRecordBodyData` middleware is added, which complements the equivalent `linkerd_http_prom::body_data::response` middleware. * this is added to policy routes' metrics layer. see prometheus/client_rust#241 and prometheus/client_rust#242, which track upstream proposals to add accessors to `Histogram` that will allow us to make test assertions that metrics are working properly. for now, these are feature gated as also done in #3308. Signed-off-by: katelyn martin <[email protected]>
this PR, based upon #3308, generalizes the
ExtractParam<P, T>
type used to retrieve Prometheus labels for the route-level retry middleware. this is a helpful component we'll want in order to build route-level frame counting middleware.refactor(app): Hoist label extractor out of retry middleware
this commit promotes the
RetryLabelExtract
type out of the route retry middleware, and into the metricssubmodule.
in preparation for generalizing this component, we rename it to
RouteLabelExtract
.refactor(app): Outline route label extraction
this addresses the
TODO
comment, moving theRouteLabelExtract
type out of the policy route layerfunction.
this defines a method on
MatchedRoute
which may be called to retrieve aRouteLabelExtract
. that typeholds references to the contruction-time information about the route, and can be used to later inspect an
outbound request at call-time, returning a
labels::Route
set of labels.this is a helpful piece of reusable glue that is broadly useful in instrumenting our route-level
middleware.
🔗 related