MCPcopy Index your code
hub / github.com/prometheus/client_python / _validate_exemplar

Function _validate_exemplar

prometheus_client/validation.py:116–124  ·  view source on GitHub ↗

Raises ValueError if the exemplar is invalid.

(exemplar)

Source from the content-addressed store, hash-verified

114
115
116def _validate_exemplar(exemplar):
117 """Raises ValueError if the exemplar is invalid."""
118 runes = 0
119 for k, v in exemplar.items():
120 _validate_labelname(k)
121 runes += len(k)
122 runes += len(v)
123 if runes > 128:
124 raise ValueError('Exemplar labels have %d UTF-8 characters, exceeding the limit of 128')

Callers 2

incMethod · 0.85
observeMethod · 0.85

Calls 1

_validate_labelnameFunction · 0.85

Tested by

no test coverage detected