Gauge metric over time to availability of consul

we use consul and push consul metrics to prometheus using telegraf…
this is consul.autopilot.healthy consul metric tells about health of consul cluster that is type guage
to know availability of the cluster I’m using avg_over_time(consul_autopilot_healthy[1y])
but some how telegraf pushing ipaddress as one of the label… over time this label might change that giving different resultsis there anyway ignore ipaddress label to get correct results?

You can use an aggregation function to remove labels (using without). If there will only ever be once instance at a time the exact function probably doesn’t matter, but in general if you have a gauge which is either 0 or 1 (for unhealthy/healthy) I would probably use min, so something like:

avg_over_time(min without (instance) consul_autopilot_healthy)[1y]

thanks @stuart … i’ve another question if metric itself absent for some time how do we calculate the availability?