Skip to content

Commit

Permalink
remove promehteus file management
Browse files Browse the repository at this point in the history
  • Loading branch information
ekneg54 committed Oct 24, 2023
1 parent 866593c commit d5f5960
Showing 1 changed file with 0 additions and 11 deletions.
11 changes: 0 additions & 11 deletions logprep/util/prometheus_exporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,6 @@ def _prepare_multiprocessing(self):
Sets up the proper metric registry for multiprocessing and handles the necessary
temporary multiprocessing directory that the prometheus client expects.
"""
if os.environ.get("PROMETHEUS_MULTIPROC_DIR"):
self.multi_processing_dir = os.environ.get("PROMETHEUS_MULTIPROC_DIR")
else:
self.multi_processing_dir = f"{tempfile.gettempdir()}/logprep/prometheus_multiproc_dir"
if os.path.isdir(self.multi_processing_dir):
shutil.rmtree(self.multi_processing_dir)
if os.path.isfile(self.multi_processing_dir):
raise ValueError(
"Environment variable 'PROMETHEUS_MULTIPROC_DIR' is a file and not a directory"
)
os.makedirs(self.multi_processing_dir, exist_ok=True)
multiprocess.MultiProcessCollector(REGISTRY, self.multi_processing_dir)

def remove_metrics_from_process(self, pid):
Expand Down

0 comments on commit d5f5960

Please sign in to comment.