File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change 1111
1212class MultiProcessCollector (object ):
1313 """Collector for files for multi-process mode."""
14- def __init__ (self , registry , path = os .environ .get ('prometheus_multiproc_dir' )):
14+ def __init__ (self , registry , path = None ):
15+ if path is None :
16+ path = os .environ .get ('prometheus_multiproc_dir' )
1517 if not path or not os .path .isdir (path ):
1618 raise ValueError ('env prometheus_multiproc_dir is not set or not a directory' )
1719 self ._path = path
@@ -88,8 +90,10 @@ def collect(self):
8890 return metrics .values ()
8991
9092
91- def mark_process_dead (pid , path = os . environ . get ( 'prometheus_multiproc_dir' ) ):
93+ def mark_process_dead (pid , path = None ):
9294 """Do bookkeeping for when one process dies in a multi-process setup."""
95+ if path is None :
96+ path = os .environ .get ('prometheus_multiproc_dir' )
9397 for f in glob .glob (os .path .join (path , 'gauge_livesum_{0}.db' .format (pid ))):
9498 os .remove (f )
9599 for f in glob .glob (os .path .join (path , 'gauge_liveall_{0}.db' .format (pid ))):
You can’t perform that action at this time.
0 commit comments