optimise prometheus scraping workflow - #13650
DaanHoogland wants to merge 10 commits into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## 4.20 #13650 +/- ##
============================================
+ Coverage 16.32% 16.35% +0.02%
- Complexity 13556 13578 +22
============================================
Files 5669 5669
Lines 501399 501417 +18
Branches 60902 60905 +3
============================================
+ Hits 81847 81987 +140
+ Misses 410390 410265 -125
- Partials 9162 9165 +3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
7835881 to
d765e5d
Compare
1951bdb to
2d2c40b
Compare
|
|
[SF] Trillian test result (tid-16835)
|
|
@NuxRo please test? @Damans227 and @shwstppr , can you review? |
| private synchronized ExecutorService getCapacityExecutorService() { | ||
| if (capacityExecutorService == null || capacityExecutorService.isShutdown()) { | ||
| capacityExecutorService = Executors.newFixedThreadPool( | ||
| Math.max(1, CapacityManager.CapacityCalculateWorkers.value()), |
There was a problem hiding this comment.
workers setting only gets read once now, so changing it needs a restart? earlier it picked up new value each run, is that ok?
| public void updateMetrics() { | ||
| public synchronized void updateMetrics() { | ||
| final long minIntervalMs = TimeUnit.SECONDS.toMillis(PrometheusExporterServer.PrometheusExporterMinRefreshInterval.value()); | ||
| final long now = System.currentTimeMillis(); |
There was a problem hiding this comment.
if server clock goes back, wont scrapes get skipped and metrics go stale? maybe nanoTime here?



Description
This PR...
Fixes: #13586
this should solve the issue, but claude suggested the following improvements as well:
if anyone wants to, these are nice to haves/good first issue ;)
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?
How did you try to break this feature and the system with this change?