Hey.
For a metric that is a timestamp, I wondered whether the unit is timestamp_seconds or seconds?
From Metric and label naming | Prometheus I’d infer the former, from OpenMetrics 1.0 | Prometheus rather the latter.
In general, I’d tend to say it’s the former, because seconds alone are merely a time duration, not a specific point in time… i.e. for the UNIX time (which timestamps use) the critical information is where the duration starts.
Now why am I asking? Cause I think this makes a difference how one should name metrics.
Consider I have an exporter, where I collect multiple pieces of raw data and from the produce my metric samples… I do collect the timestamps of each piece of raw data and want to export “meta” statistics about them, like the max/min timestamp of each scrape (so that people can calculate the spread) or perhaps the standard deviation.
I can think of e.g. the following naming schemas:
info_raw_data_timestamps_min_timestamp_seconds
info_raw_data_timestamps_max_timestamp_seconds
info_raw_data_timestamps_mean_timestamp_seconds
info_raw_data_timestamps_median_timestamp_seconds
info_raw_data_timestamps_stddev
The idea would be that first one has info_ like meta information about the exporter itself, then the object about what (the raw_data) and sub-object (thetimestaps of the raw data), then from these the min/max/mean/etc. timestamp in seconds.
That I’d probably choose if timestamp_seconds were the unit.
If it were just seconds, I’d probably rather go for:
info_raw_data_timestamps_min_seconds
or maybe even:
info_raw_data_timestamp_min_seconds
info_raw_data_min_timestamp_seconds
Cheers,
Chris