Make pageserver_ prefix for common metric names configurable (#681)

This commit is contained in:
Egor Suvorov
2021-10-05 19:06:44 +03:00
committed by GitHub
parent 9c936034b6
commit 7e190d72a5
6 changed files with 29 additions and 4 deletions

View File

@@ -136,7 +136,8 @@ class ZenithBenchmarker:
# The metric should be an integer, as it's a number of bytes. But in general
# all prometheus metrics are floats. So to be pedantic, read it as a float
# and round to integer.
matches = re.search(r'pageserver_disk_io_bytes{io_operation="write"} (\S+)', all_metrics)
matches = re.search(r'^pageserver_disk_io_bytes{io_operation="write"} (\S+)$', all_metrics,
re.MULTILINE)
return int(round(float(matches.group(1))))
@contextmanager