All structured logs and metrics measured in units should include a suffix in their name
Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.
Structured logs and metrics should have an appropriate suffix.
For Prometheus metrics, we should stick to the prometheus naming conventions:
- ..should have a suffix describing the unit, in plural form. Note that an accumulating count has total as a suffix, in addition to the unit if applicable.
http_request_duration_secondsnode_memory_usage_byteshttp_requests_total(for a unit-less accumulating count)process_cpu_seconds_total(for an accumulating count with unit)foobar_build_info(for a pseudo-metric that provides metadata about the running binary)
For structured logging, the unit should be abbreviated (to save bandwidth) and use the following unit prefixes:
-
duration_sDuration in seconds -
duration_msDuration in milliseconds (discouraged, prefer seconds) -
size_bSize in bytes
For structured logging, unit-less values should not have a prefix:
gitaly_callsdb_calls
The following discussion from !18066 (merged) should be addressed:
-
@ayufan started a discussion: (+1 comment) Make it clear: in
_ms.Should we create an issue to change the
durationto beduration_sfor the consistency purposes and deprecateduration?
Edited by 🤖 GitLab Bot 🤖