Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion prometheus_client/openmetrics/exposition.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def generate_latest(registry, escaping=UNDERSCORES, version="1.0.0"):
if escaping == ALLOWUTF8 and not _is_valid_legacy_metric_name(s.name):
labelstr = escape_metric_name(s.name, escaping)
if s.labels:
labelstr += ', '
labelstr += ','
else:
labelstr = ''

Expand Down
4 changes: 2 additions & 2 deletions tests/openmetrics/test_exposition.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ def test_native_histogram_utf8_stress(self) -> None:
self.custom_collector(hfm)
self.assertEqual(b"""# HELP "native{histogram" Is a basic example of a native histogram
# TYPE "native{histogram" histogram
{"native{histogram", "xx{} # {}"=" EOF # {}}}"} {count:24,sum:100,schema:0,zero_threshold:0.001,zero_count:4,negative_spans:[0:2,1:2],negative_deltas:[2,1,-2,3],positive_spans:[0:2,1:2],positive_deltas:[2,1,-3,3]}
{"native{histogram","xx{} # {}"=" EOF # {}}}"} {count:24,sum:100,schema:0,zero_threshold:0.001,zero_count:4,negative_spans:[0:2,1:2],negative_deltas:[2,1,-2,3],positive_spans:[0:2,1:2],positive_deltas:[2,1,-3,3]}
# EOF
""", generate_latest(self.registry, ALLOWUTF8, version="2.0.0"))

Expand All @@ -189,7 +189,7 @@ def test_native_histogram_with_labels_utf8(self) -> None:
self.custom_collector(hfm)
self.assertEqual(b"""# HELP "hist.w.labels" Is a basic example of a native histogram with labels
# TYPE "hist.w.labels" histogram
{"hist.w.labels", baz="qux",foo="bar"} {count:24,sum:100,schema:0,zero_threshold:0.001,zero_count:4,negative_spans:[0:2,1:2],negative_deltas:[2,1,-2,3],positive_spans:[0:2,1:2],positive_deltas:[2,1,-3,3]}
{"hist.w.labels",baz="qux",foo="bar"} {count:24,sum:100,schema:0,zero_threshold:0.001,zero_count:4,negative_spans:[0:2,1:2],negative_deltas:[2,1,-2,3],positive_spans:[0:2,1:2],positive_deltas:[2,1,-3,3]}
# EOF
""", generate_latest(self.registry, ALLOWUTF8, version="2.0.0"))

Expand Down