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
{{ message }}
Repository navigation
[surfacers.prometheus] Consider either deleting stale gauge metrics by default or always include timestamp for them #1162
We recently made some changes to prometheus surfacer which encourage timestamp-less exporting, the reason being:
a) if you include timestamp, you'll have to make sure you don't export metrics with timestamps older than 10m, that causes warnings in prometheus metrics scraper. Also this behavior is not right for cumulative metrics if they update infrequently -- prometheus will show gap in data, and sometimes even expire the timeseries if gap is too large.
b) if you don't include timestamps, stale metrics warning goes away, but prometheus continues to consider the scraped value as the current value.
Note that the latter behavior (no timestamp) is fine for cumulative metrics, as it's easy to identify that the value has not changed. But for gauge metrics it's problematic -- they are true at a particular time, not 15 min later for example.
We should make this behavior explicit in configuration. Maybe gauge metrics should always carry timestamps and their stale values should always be deleted, regardless of the config.
My proposal will be to change the default behavior of include_timestamp based on type of metrics -- for cumulative metrics timestamp will not be included and for gauge it will be included.
Activity
manugarg commentedon Oct 23, 2025
My proposal will be to change the default behavior of
include_timestampbased on type of metrics -- for cumulative metrics timestamp will not be included and for gauge it will be included.cloudprober/surfacers/internal/prometheus/proto/config.proto
Line 15 in 5590ff7
manugarg commentedon Nov 3, 2025
#1169 should do it.
[surfacers.prometheus] Change include_timestamp's default behavior (#…
manugarg commentedon Nov 4, 2025
#1169 should fix it.