feat: Make feature-count latency histogram bins configurable

Open
#6,640 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
68/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Quiet
Tech stack
python
Domain
observability

Research direction

Start with sdk/python/feast/metrics.py and sdk/python/feast/feature_server.py, tracing RequestMetricsContext.feature_count and track_request_latency. Review MetricsConfig and the feature-server documentation to determine how feature_count_bins should be exposed; done means configurable bounded bin labels are used, with the suggested defaults documented and feature_view_count addressed if applicable.

Written by the indexing model from the issue text.

Description

Follow-up from #5920 (Improve Feature Server Observability).

Problem

request_latency in sdk/python/feast/metrics.py is labeled with feature_count using the raw count of features requested (see track_request_latency / RequestMetricsContext.feature_count). Raw counts create unbounded label cardinality — every distinct feature count seen in production becomes its own time series. The issue asks for configurable bins instead, e.g. 1-10, 11-50, 51-200, 201+.

Proposed solution

  • Add a binning function (e.g. bin_feature_count(count: int, bins: list[int]) -> str) that maps a raw feature count to a bin label like "1-10", "11-50", "51-200", "201+".
  • Default bins should match the issue's suggestion (1-10, 11-50, 51-200, 201+) but should be configurable via MetricsConfig in feature_store.yaml (e.g. metrics.feature_count_bins: [10, 50, 200]).
  • Apply this wherever feature_count is currently set as a raw value before being passed into RequestMetricsContext in sdk/python/feast/feature_server.py.
  • Same treatment could apply to feature_view_count.
  • Update relevant docs (docs/getting-started/components/feature-server.md or wherever metrics config is documented) to describe the new config option.

cc: @jyejare @ntkathole

Dominant language
Python
Stars
7.4k
Forks
1.5k
Avg merge
2d 6h
Merged PRs (30d)
107

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from feast-dev/feast

All issues in feast-dev/feast

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.