From e3e854e64b0550c84994483ef6ad2f68c1e97a02 Mon Sep 17 00:00:00 2001 From: Aljosha Friemann Date: Mon, 26 Mar 2018 17:54:10 +0200 Subject: [PATCH] added _max to summary allowed_names --- prometheus_client/parser.py | 2 +- tests/test_parser.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/prometheus_client/parser.py b/prometheus_client/parser.py index 9115659b..fe9db1c0 100644 --- a/prometheus_client/parser.py +++ b/prometheus_client/parser.py @@ -195,7 +195,7 @@ def build_metric(name, documentation, typ, samples): allowed_names = { 'counter': [''], 'gauge': [''], - 'summary': ['_count', '_sum', ''], + 'summary': ['_count', '_sum', '_max', ''], 'histogram': ['_count', '_sum', '_bucket'], }.get(typ, ['']) allowed_names = [name + n for n in allowed_names] diff --git a/tests/test_parser.py b/tests/test_parser.py index 0a340e07..7070bac3 100644 --- a/tests/test_parser.py +++ b/tests/test_parser.py @@ -207,6 +207,7 @@ def test_roundtrip(self): go_gc_duration_seconds{quantile="1"} 0.021383540000000003 go_gc_duration_seconds_sum 56.12904785 go_gc_duration_seconds_count 7476.0 +go_gc_duration_seconds_max 0.0 # HELP go_goroutines Number of goroutines that currently exist. # TYPE go_goroutines gauge go_goroutines 166.0