Per-collection metrics for Prometheus #4455
Draft
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.
/claim #3322
All Submissions:
dev
branch. Did you create your branch fromdev
?New Feature Submissions:
cargo +nightly fmt --all
command prior to submission?cargo clippy --all --all-features
command?Changes to Core Features:
Per-Collection metrics
Please consider my attempt as well. With the current iteration, it looks like this:
New Metrics Output
For now, the per-collection metrics are implemnted for webapi-based routes,
but for gRPC they are not.
It's difficult to do the same for gRPC because there's no straightforward way
to extract the collection name from the request body:
http
andhyper
crates than tonic, then the exported traits are different, and thus I was unable to come up with a solution to parse the request body from within the middleware layer in a finite amount of time,http
andhyper
to the versionstonic
is using, we still cannot parse the body without consuming the request -- surely, we can consume the request, clone its parts, and pass the cloned one on to the handlers, but I feel bit uneasy about doing this for a purely cosmetic feature.Perhaps it's worth talking to Tonic if it's possible to introduce an api to peek into the request body inside a middleware layer.
To make sure there is no performance regression, I benchmarked it as follows:
Before:
After:
Before going further, I wanted to check with the code owners whether we are content with the schema change mentioned above?
If we don't want to change the telemetry schema presented to the user, can untie stored
*TelemetryData
from presented, and split the structure in two?