Skip to content

feat: add tracked object counts metric#1247

Merged
glevco merged 1 commit intomasterfrom
feat/add-gc-metrics
Nov 3, 2025
Merged

feat: add tracked object counts metric#1247
glevco merged 1 commit intomasterfrom
feat/add-gc-metrics

Conversation

@glevco
Copy link
Contributor

@glevco glevco commented Mar 19, 2025

Motivation

The Prometheus garbage collector objects metric does not currently reflect the tracked objects count, but a different count according to the docs:

Return the current collection counts as a tuple of (count0, count1, count2).

This PR adds the tracked_objects metric that gets the correct value, and keeps the objects metric with an updated description. Also, for reference.

Acceptance Criteria

  • Change HathorSettings.PROMETHEUS_WRITE_INTERVAL from 5 seconds to 15 seconds, as our Prometheus server only scraps the full node every 30s, so we're making too many unnecessary updates.
  • Add new Prometheus tracked_objects garbage collector metric.
  • Fix Prometheus objects garbage collector metric description and rename it to collection_counts.
  • Update GC metrics separately from the other metrics, with a default interval of 60 seconds.

Checklist

  • If you are requesting a merge into master, confirm this code is production-ready and can be included in future releases as soon as it gets merged

@glevco glevco requested a review from luislhl March 19, 2025 21:33
@glevco glevco self-assigned this Mar 19, 2025
@glevco glevco moved this from Todo to In Progress (Done) in Hathor Network Mar 19, 2025
@glevco glevco force-pushed the feat/add-gc-metrics branch from ec1ac1a to 3d9c2ae Compare March 19, 2025 21:38
@github-actions
Copy link

github-actions bot commented Mar 19, 2025

🐰 Bencher Report

Branchfeat/add-gc-metrics
Testbedubuntu-22.04
Click to view all benchmark results
BenchmarkLatencyBenchmark Result
minutes (m)
(Result Δ%)
Lower Boundary
minutes (m)
(Limit %)
Upper Boundary
minutes (m)
(Limit %)
sync-v2 (up to 20000 blocks)📈 view plot
🚷 view threshold
1.72 m
(-0.74%)Baseline: 1.73 m
1.56 m
(90.67%)
2.08 m
(82.71%)
🐰 View full continuous benchmarking report in Bencher

@codecov
Copy link

codecov bot commented Mar 19, 2025

Codecov Report

❌ Patch coverage is 75.00000% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 86.11%. Comparing base (a54c01c) to head (96c52a6).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
hathor/prometheus.py 66.66% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1247      +/-   ##
==========================================
+ Coverage   86.06%   86.11%   +0.04%     
==========================================
  Files         437      437              
  Lines       33967    33972       +5     
  Branches     5316     5316              
==========================================
+ Hits        29235    29256      +21     
+ Misses       3684     3675       -9     
+ Partials     1048     1041       -7     

☔ 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.

@luislhl luislhl moved this from In Progress (Done) to In Review (WIP) in Hathor Network Mar 20, 2025
@glevco glevco moved this from In Review (WIP) to In Progress (WIP) in Hathor Network Sep 5, 2025
@glevco glevco force-pushed the feat/add-gc-metrics branch 2 times, most recently from 6e8dfe3 to 4e142bd Compare October 24, 2025 14:39
@glevco glevco moved this from In Progress (WIP) to In Progress (Done) in Hathor Network Oct 24, 2025
@luislhl luislhl moved this from In Progress (Done) to In Review (WIP) in Hathor Network Oct 28, 2025
@glevco glevco force-pushed the feat/add-gc-metrics branch from 4e142bd to 96c52a6 Compare November 3, 2025 14:32
@glevco glevco merged commit 756b26b into master Nov 3, 2025
8 checks passed
@glevco glevco deleted the feat/add-gc-metrics branch November 3, 2025 15:18
@github-project-automation github-project-automation bot moved this from In Review (WIP) to Waiting to be deployed in Hathor Network Nov 3, 2025
This was referenced Dec 2, 2025
@jansegre jansegre moved this from Waiting to be deployed to Done in Hathor Network Dec 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants