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

feat(app): Route frame count metrics #3334

Merged
merged 1 commit into from
Nov 21, 2024
Merged

Conversation

cratelyn
Copy link
Collaborator

@cratelyn cratelyn commented Nov 6, 2024

feat(app): Route frame count metrics

⛅ 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.


🔗 related

@cratelyn cratelyn force-pushed the kate/record-body-data-part-deux branch from 378e494 to 843f57c Compare November 7, 2024 06:00
@cratelyn cratelyn changed the title feat(app): Route request frame count metrics feat(app): Route request frame count metrics (wip) Nov 7, 2024
@cratelyn cratelyn force-pushed the kate/record-body-data-part-deux branch from 843f57c to 82d97be Compare November 7, 2024 06:37
@cratelyn cratelyn changed the base branch from kate/record-body-data to kate/hoist-route-label-extractor November 7, 2024 06:37
@cratelyn cratelyn force-pushed the kate/record-body-data-part-deux branch from cc0e8f0 to 67d56a0 Compare November 10, 2024 22:29
@cratelyn cratelyn force-pushed the kate/hoist-route-label-extractor branch from 2d8d0f2 to a75492c Compare November 10, 2024 22:37
@cratelyn cratelyn force-pushed the kate/record-body-data-part-deux branch 2 times, most recently from 3ae2592 to 082cb90 Compare November 10, 2024 22:39
@cratelyn cratelyn changed the title feat(app): Route request frame count metrics (wip) feat(app): Route frame count metrics Nov 10, 2024
@cratelyn cratelyn force-pushed the kate/record-body-data-part-deux branch from 082cb90 to 878881d Compare November 10, 2024 23:07
@cratelyn cratelyn marked this pull request as ready for review November 11, 2024 01:26
@cratelyn cratelyn requested a review from a team as a code owner November 11, 2024 01:26
@cratelyn cratelyn force-pushed the kate/hoist-route-label-extractor branch 2 times, most recently from a84a157 to 71cca7f Compare November 21, 2024 14:50
Base automatically changed from kate/hoist-route-label-extractor to main November 21, 2024 14:56
@cratelyn cratelyn force-pushed the kate/record-body-data-part-deux branch from 878881d to 8868a39 Compare November 21, 2024 15:01
@cratelyn cratelyn marked this pull request as draft November 21, 2024 15:02
@cratelyn
Copy link
Collaborator Author

rebased onto main now that #3308 and #3337 have landed, going to apply the same transformation to this as performed in review of #3308 here, and then re-open this as ready for review.

 ### ⛅ 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]>
@cratelyn cratelyn force-pushed the kate/record-body-data-part-deux branch from 389f7dc to 94f39e4 Compare November 21, 2024 16:36
@cratelyn cratelyn marked this pull request as ready for review November 21, 2024 16:44
@cratelyn cratelyn requested a review from olix0r November 21, 2024 16:45
Copy link
Member

@olix0r olix0r left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🌮 🎉

@cratelyn cratelyn merged commit e4d7d57 into main Nov 21, 2024
15 checks passed
@cratelyn cratelyn deleted the kate/record-body-data-part-deux branch November 21, 2024 19:43
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