Closed mkcp closed 4 years ago
Please hold off on reviewing and/or merging this - I've put together an alternate solution that solves the initialization problem as well as the retention and NaN-expiry problem this one PR solves. I'm getting some more feedback before submitting it up as a PR.
Closed in favor of the approach in #120
Also adds doccomments to structs.
The reasoning for this change is quoted from the PrometheusOpts docs:
In short, this allows us to set a config flag that prevents metrics from being deleted when they expire. Instead they are set to NaN or ignored if we can safely assume their last value.
This new behavior and config allows us to resolve a long-requested pain point with how Consul expires metrics it has not observed within its prometheus_retention_time, which we set PrometheusSink's expiry value with. Workarounds for this have led to users configuring retention times on the order of days, weeks, and months leading to a pathological loss of precision in metrics which do not update often. Not all of these metrics remain valid even if we haven't updated them. With this change we can recommend much shorter retention times which will lead to more accurate measurements and fewer bogus stats.