File tree 1 file changed +6
-2
lines changed 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change 11
11
12
12
class MultiProcessCollector (object ):
13
13
"""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' )
15
17
if not path or not os .path .isdir (path ):
16
18
raise ValueError ('env prometheus_multiproc_dir is not set or not a directory' )
17
19
self ._path = path
@@ -88,8 +90,10 @@ def collect(self):
88
90
return metrics .values ()
89
91
90
92
91
- def mark_process_dead (pid , path = os . environ . get ( 'prometheus_multiproc_dir' ) ):
93
+ def mark_process_dead (pid , path = None ):
92
94
"""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' )
93
97
for f in glob .glob (os .path .join (path , 'gauge_livesum_{0}.db' .format (pid ))):
94
98
os .remove (f )
95
99
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