Skip to content

feat(das): add das_sampling_head_lag metric - #5307

Merged
renaynay merged 3 commits into
celestiaorg:mainfrom
operagxsasha:feat/das-sampling-lag-metrics
Oct 2, 2026
Merged

renaynay merged 3 commits into
celestiaorg:mainfrom
operagxsasha:feat/das-sampling-lag-metrics

Conversation

@operagxsasha

Copy link
Copy Markdown
Contributor

Partially addresses #3273.

This adds a das_sampling_head_lag gauge that shows how many headers the sampled chain head is behind the network head (NetworkHead - SampledChainHead, never below 0). It reuses the stats the metrics callback already reads, so there's no extra cost. I also added a small unit test for the calculation.

I left out the time-based lag from the issue, since it needs the header timestamp at SampledChainHead. Happy to add it here or in a follow-up, whichever you prefer.

Adds a gauge reporting how many headers the sampled chain head is behind the network head. Partially addresses celestiaorg#3273.
@operagxsasha
operagxsasha requested a review from a team as a code owner October 1, 2026 11:20
@operagxsasha
operagxsasha requested a review from renaynay October 1, 2026 11:20
@github-actions github-actions Bot added the external Issues created by non node team members label Oct 1, 2026
@greptile-apps

greptile-apps Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 5/5

[Low risk] Adds a new observability metric to the data availability sampler.

No outstanding findings block merging.

Summary

This PR adds das_sampling_head_lag from the stats already read by the metrics callback. Since the last review, the metric-collection test was removed; the calculation test remains.

Reviews (3) · Last reviewed commit: "test(das): drop head lag collection test"

Comment thread das/metrics_test.go
greptile-apps[bot]
greptile-apps Bot previously approved these changes Oct 1, 2026

@renaynay renaynay left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Pls drop TestHeadLagMetricIsCollected (which is failing repeated runs) bc TestHeadLagOf already covers the only new logic

@codecov

codecov Bot commented Oct 2, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 40.00000% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 37.49%. Comparing base (42addd6) to head (8ff32fb).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
das/metrics.go 40.00% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5307      +/-   ##
==========================================
- Coverage   37.52%   37.49%   -0.03%     
==========================================
  Files         321      321              
  Lines       22323    22332       +9     
==========================================
- Hits         8376     8374       -2     
- Misses      12922    12929       +7     
- Partials     1025     1029       +4     

☔ View full report in Codecov by Harness.
📢 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.

@operagxsasha

Copy link
Copy Markdown
Contributor Author

Pls drop TestHeadLagMetricIsCollected (which is failing repeated runs) bc TestHeadLagOf already covers the only new logic

done

@operagxsasha
operagxsasha requested a review from renaynay October 2, 2026 11:51
@renaynay
renaynay added this pull request to the merge queue Oct 2, 2026
Merged via the queue into celestiaorg:main with commit ffda767 Oct 2, 2026
45 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

external Issues created by non node team members

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants