Skip to content

Commit

Permalink
Merge pull request #752 from roboflow/fix/disable-custom-scraping-for…
Browse files Browse the repository at this point in the history
…-parallel-containers

Disable scraping for containers where model_manager is not defined
  • Loading branch information
PawelPeczek-Roboflow authored Oct 18, 2024
2 parents c981884 + 192836f commit e94a588
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions inference/core/managers/prometheus.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ def get_metrics(self, maxModels: int = 25):
start = now - self.time_window
count = 0
results = {}
if self.model_manager is None:
logger.warning(
"This inference server type does not support custom Prometheus metrics, skipping."
)
return results
for model_id in self.model_manager.models():
if count >= maxModels:
break
Expand Down

0 comments on commit e94a588

Please sign in to comment.