You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I try to assign a function to a Gauge using set_function(), the Prometheus library does not error even if the labels are missing.
This code should error, but it does not:
importprometheus_clientprocessed_input_messages=prometheus_client.Gauge(
name="my_gauge",
documentation="A generic Gauge.",
labelnames=["a", "b"],
)
if__name__=='__main__':
# This should fail, because the "a" and "b" labels are not provided!processed_input_messages.set_function(lambda: 1)
In general, it would be important to check, for every metric type, if all the labels are set when calling .set(), .inc(), .set_function(), and the other similar metrics.
The text was updated successfully, but these errors were encountered:
If I try to assign a function to a Gauge using
set_function()
, the Prometheus library does not error even if the labels are missing.This code should error, but it does not:
In general, it would be important to check, for every metric type, if all the labels are set when calling
.set()
,.inc()
,.set_function()
, and the other similar metrics.The text was updated successfully, but these errors were encountered: