Skip to content

Commit 165fe91

Browse files
committed
Extract stats correctly when extra '.' in path
It appears that a recent cbcollect change adds a redundant '.' to the path that the Prometheus stats snaphot is added to the zip file with. E.g we now see this in the path in the zip file [email protected]_20220610-011859/./stats_snapshot whereas previously we saw this: [email protected]_20220610-011859/stats_snapshot It probably would be preferable to not have this additional, unnecessary current directory in the path. But it should be the case that Promtimer should handle it regardless.
1 parent b510b95 commit 165fe91

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

promtimer/cbstats.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,8 @@ def snapshot_dir_exists(candidate_cbcollect_dir):
202202
candidate_cbcollect_dir exists.
203203
:type candidate_cbcollect_dir: ,lib.Path
204204
"""
205-
return CBCollect.make_snapshot_dir_path(candidate_cbcollect_dir).exists()
205+
return CBCollect.make_snapshot_dir_path(candidate_cbcollect_dir).exists() or \
206+
CBCollect.make_snapshot_dir_path(candidate_cbcollect_dir / '.').exists()
206207

207208
@staticmethod
208209
def is_cbcollect_dir(candidate_path):

0 commit comments

Comments
 (0)