Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/rmsv2 #111

Open
wants to merge 13 commits into
base: features/m2m
Choose a base branch
from
Prev Previous commit
Next Next commit
fixed bug with incorrectly removing metrics when job is done
Omri Avraham committed Oct 3, 2024
commit 3a7042a5dad781136367577ff4aefb63dcfa1650
11 changes: 7 additions & 4 deletions omnistat/collector_rms_v2.py
Original file line number Diff line number Diff line change
@@ -76,16 +76,19 @@ def updateMetrics(self):

self.collect_data_incremental()
# Remove old labels for jobs not currently running
for metric, counter in self.__RunningJobs.items():
running_jobs = self.__RunningJobs.copy()
for metric, counter in running_jobs.items():
if counter < self.c:
# catch edge case for multiple metrics with same name
try:
self.__RMSMetrics["info"].remove(metric[0], metric[1], metric[2], metric[3], metric[4], metric[5], metric[6], metric[7], metric[8])
self.__RMSMetrics["info"].remove(*metric)
self.__RunningJobs.pop(metric)
logging.debug(f"Job done, removing metric: {metric}")
except Exception as e:
logging.error(f"Failed to remove metric: {metric}\n"
f"error: {e}\n"
f"Error: {e}\n"
f"Running Jobs: {self.__RunningJobs}\n"
f"Metrics: {self.__RMSMetrics}")
f"Gauge Metrics: {self.__RMSMetrics['info']._metrics}")
pass

return