Skip to content
Open
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: 2 additions & 1 deletion prometheus_client/metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ def _raise_if_not_observable(self):
# Functions that mutate the state of the metric, for example incrementing
# a counter, will fail if the metric is not observable, because only if a
# metric is observable will the value be initialized.
if not self._is_observable():
# This is the inverse of _is_observable(), inlined as it runs on every update.
if self._labelnames and not self._labelvalues:
raise ValueError('%s metric is missing label values' % str(self._type))

def _is_parent(self):
Expand Down