Skip to content
Merged
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
3 changes: 0 additions & 3 deletions prometheus_client/validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ def _init_legacy_validation() -> bool:

def get_legacy_validation() -> bool:
"""Return the current status of the legacy validation setting."""
global _legacy_validation
return _legacy_validation


Expand All @@ -39,7 +38,6 @@ def _validate_metric_name(name: str) -> None:
"""
if not name:
raise ValueError("metric name cannot be empty")
global _legacy_validation
if _legacy_validation:
if not METRIC_NAME_RE.match(name):
raise ValueError("invalid metric name " + name)
Expand All @@ -63,7 +61,6 @@ def _validate_metric_label_name_token(tok: str) -> None:
"""
if not tok:
raise ValueError("invalid label name token " + tok)
global _legacy_validation
quoted = tok[0] == '"' and tok[-1] == '"'
if not quoted or _legacy_validation:
if not METRIC_LABEL_NAME_RE.match(tok):
Expand Down