Repository navigation
feat: Add HTTP status class label to feature server request metrics - #7138
Merged
ntkathole merged 1 commit intoNov 13, 2026
Merged
Conversation
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #7138 +/- ##
==========================================
+ Coverage 52.31% 52.38% +0.07%
==========================================
Files 459 459
Lines 58080 58154 +74
Branches 8556 8572 +16
==========================================
+ Hits 30382 30464 +82
+ Misses 25614 25608 -6
+ Partials 2084 2082 -2
... and 3 files with indirect coverage changes Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
franciscojavierarceo
approved these changes
Nov 13, 2026
feast_feature_server_request_total was labelled with endpoint and a status that was only ever "success" or "error", and the status came from whether the handler raised. Client errors and server errors fell into the same bucket, and handlers that returned an error response without raising (a 404 or 422 from the vector store search, a 409 when a materialization is already running) were counted as successes. The counter now carries a status_class label (2xx, 4xx, 5xx) taken from the HTTP status code the server responds with: - When the handler raises, the status code is derived the same way the REST exception handling answers: FeastError subclasses use their own http_status_code(), HTTPException uses its status_code, and anything else is a 500. - RequestMetricsContext gains a status_code attribute (default 200) that handlers set when they return a non-2xx response. The vector store search and the async /materialize and /materialize-incremental conflict paths now do so. The existing status label is kept for dashboards and alerts that use it, and is now derived from the status code as well: "success" below 400 and "error" otherwise. The metrics reference and the performance tuning guide document the new label. Fixes feast-dev#6641 Signed-off-by: NopeCharon <[email protected]>
ntkathole
force-pushed
the
feat/request-metrics-status-class
branch
from
November 13, 2026 12:49
485d28f to
f236f76
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What this PR does / why we need it:
feast_feature_server_request_totalis labelledendpoint, status, andstatusis only eversuccessorerror, depending on whether the handler raised. That has two problems:errorbucket, so you can't alert on server-side failures without also paging on bad client requests.success. That covers the 404 and 422 from/v1/vector_stores/{id}/search, and the 409 from async/materializeand/materialize-incrementalwhen a materialization is already running.This PR adds a
status_classlabel (2xx,4xx,5xx) based on the HTTP status code the server actually responds with:FeastErrorsubclasses use their ownhttp_status_code(),HTTPExceptionuses itsstatus_code, and anything else is a 500.RequestMetricsContextgets astatus_codeattribute (default200), following the existingfeature_count/feature_view_countpattern. Handlers set it when they return a non-2xx response. The vector store search and the two materialize conflict paths now do this.statuslabel stays, so dashboards and alerts that use it keep working. It is now derived from the status code too:successbelow 400,errorotherwise. The only behaviour change is that the returned 404/422/409 responses above now count aserror, notsuccess.status_classis added only to the counter, not to the latency histogram, so histogram cardinality does not change.Docs: the metrics table in the Python feature server reference now lists the label, there is a short "Request status labels" section with an example PromQL query, and the performance tuning guide mentions the label.
Example:
Which issue(s) this PR fixes:
Fixes #6641
Checks
git commit -s)Testing Strategy
New tests in
sdk/python/tests/unit/test_metrics.py:track_request_latencymaps exceptions to the right class: a plain error gives 5xx,FeatureViewNotFoundExceptionandFeastPermissionErrorgive 4xx, andHTTPException(404)/HTTPException(503)give 4xx / 5xx.status_codeset on the yielded context is used for both labels (202 givessuccess/2xx; 404, 409 and 503 giveerror)./get-online-featuresthat fails with a not-found error answers 404 and records4xx, and an unexpected error answers 500 and records5xx. Async/materializeagainst a feature view that is already materializing answers 409 and records4xx.The existing assertions now include the new label.
test_metrics.pypasses (141 tests), and 16 of those tests fail without the source change.ruff check,ruff format --checkandmypyonfeast/metrics.pyandfeast/feature_server.pyare clean.