I'm using this code to expose my metric:
g_in = GaugeMetricFamily("in_utilization", 'this is device utilization info', labels=["ckt_id", "time_val"])
g_in.add_metric([ckt_id,str(val['time'])], val['value'])
I am a newbie in Prometheus. I'm receiving utilization value with time from API call. So this time_val
represents the time when utilization has reached to given value.
Graph based on this metric is not continuous. What I am doing wrong?
You graph is not continuous because values of time_val
are different. As a result this are considered as different time series, and they are visualized as such.
I am a newbie in Prometheus. I'm receiving utilization value with time (from API call) So this time_val represents the time when utilization has reached to given value.
This is a bad idea. You are increasing cardinality of your metric for no good reason. There are couple of ways to avoid it: