In T221774 max lag started being counted when figuring out the max lag value.
Everything there is now deployed and working, but the median turns out to not be the best value to use for the lag.
The discovery team pointed us toward https://config-master.wikimedia.org/pybal/eqiad/wdqs and https://config-master.wikimedia.org/pybal/codfw/wdqs which shows the pooled servers.
Using this we would be able to actually base the maxlag for the query service on the maximum lag of pooled servers.
The maintenance script could first query these 2 config locations, creating a list of instances that we actually care about.
WikimediaPrometheusQueryServiceLagProvider:: getLags could then filter out any not pooled servers.