Skip to content

flytestdlib: add additional storage cache metrics and implement freecache prom collector#7115

Open
xjerod wants to merge 1 commit intoflyteorg:masterfrom
xjerod:union/upstream-1eb60aa132ca9b75891a9143059929632ce9c860
Open

flytestdlib: add additional storage cache metrics and implement freecache prom collector#7115
xjerod wants to merge 1 commit intoflyteorg:masterfrom
xjerod:union/upstream-1eb60aa132ca9b75891a9143059929632ce9c860

Conversation

@xjerod
Copy link
Copy Markdown

@xjerod xjerod commented Mar 30, 2026

Adds Prometheus metrics to flytestdlib/storage to help identify Flytepropeller memory consumption from the in-memory data cache and large inputs/outputs — the two main controllable sources of propeller OOM pressure.

  • rawstores.go: Scopes the cache, proto, and stow metric groups into named sub-scopes so their metrics are easier to distinguish in dashboards.
  • protobuf_store.go: Adds read_bytes_total and written_bytes_total counters to track byte volume moving through the protobuf store, surfacing executions that pass large data between tasks.
  • cached_rawstore.go: Implements the freecache prometheus.Collector (resolving a long-standing TODO), exposing snapshot metrics scraped each Prometheus interval:
    • entry_count (gauge) — current occupancy of the in-memory cache
    • evacuate_count_total — evictions due to memory pressure; the primary signal that the cache is sized too small relative to workload
    • overwrite_count_total / expired_count_total — entry churn

Also adds cache_read_bytes_total and cache_write_bytes_total counters to track cache throughput.

@xjerod xjerod force-pushed the union/upstream-1eb60aa132ca9b75891a9143059929632ce9c860 branch from 9f43cdd to 49d2c17 Compare March 30, 2026 16:31
…ache prom collector (flyteorg#937)

Adds Prometheus metrics to `flytestdlib/storage` to help identify Flytepropeller memory consumption from the in-memory data cache and large inputs/outputs — the two main controllable sources of propeller OOM pressure.

  - **`rawstores.go`**: Scopes the `cache`, `proto`, and `stow` metric groups into named sub-scopes so their metrics are easier to distinguish in dashboards.
  - **`protobuf_store.go`**: Adds `read_bytes_total` and `written_bytes_total` counters to track byte volume moving through the protobuf store, surfacing executions that pass large data between tasks.
  - **`cached_rawstore.go`**: Implements the freecache `prometheus.Collector` (resolving a long-standing TODO), exposing snapshot metrics scraped each Prometheus interval:
    - `entry_count` (gauge) — current occupancy of the in-memory cache
    - `evacuate_count_total` — evictions due to memory pressure; the primary signal that the cache is sized too small relative to workload
    - `overwrite_count_total` / `expired_count_total` — entry churn

Also adds `cache_read_bytes_total` and `cache_write_bytes_total` counters to track cache throughput.

Signed-off-by: Jerod <jerod@union.ai>
@xjerod xjerod force-pushed the union/upstream-1eb60aa132ca9b75891a9143059929632ce9c860 branch from 49d2c17 to 983a2a4 Compare March 30, 2026 16:33
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 1, 2026

Codecov Report

❌ Patch coverage is 80.00000% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 56.96%. Comparing base (74618dd) to head (983a2a4).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
flytestdlib/storage/cached_rawstore.go 75.00% 6 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7115      +/-   ##
==========================================
+ Coverage   56.94%   56.96%   +0.02%     
==========================================
  Files         931      931              
  Lines       58188    58219      +31     
==========================================
+ Hits        33135    33165      +30     
  Misses      22011    22011              
- Partials     3042     3043       +1     
Flag Coverage Δ
unittests-datacatalog 53.51% <ø> (ø)
unittests-flyteadmin 53.14% <ø> (+0.03%) ⬆️
unittests-flytecopilot 43.06% <ø> (ø)
unittests-flytectl 64.02% <ø> (ø)
unittests-flyteidl 75.71% <ø> (ø)
unittests-flyteplugins 60.15% <ø> (ø)
unittests-flytepropeller 53.65% <ø> (ø)
unittests-flytestdlib 63.12% <80.00%> (+0.09%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

1 participant