diff --git a/content/docs/practices/naming.md b/content/docs/practices/naming.md index bf89fa067..fc9d752d1 100644 --- a/content/docs/practices/naming.md +++ b/content/docs/practices/naming.md @@ -27,7 +27,7 @@ A metric name... * http\_request\_duration\_seconds (for all HTTP requests) * ...must have a single unit (i.e. do not mix seconds with milliseconds, or seconds with bytes). -* ...should use base units (e.g. seconds, bytes, meters - not milliseconds, megabytes, kilometers). See below for a list of base units. +* ...should use base units (e.g. seconds, bytes, meters - not milliseconds, megabytes, kilometers). Note that things like connections, notifications are not considered as base units.See below for a list of base units. * ...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\_seconds * node\_memory\_usage\_bytes @@ -39,26 +39,16 @@ A metric name... (for a pseudo-metric that provides [metadata](https://www.robustperception.io/exposing-the-software-version-to-prometheus) about the running binary) * data\_pipeline\_last\_record\_processed\_timestamp_seconds (for a timestamp that tracks the time of the latest record processed in a data processing pipeline) -* ...that has a `unit` in its name, should have that `unit` as the last word. Note that an accumulating count such as `total` will be the last word, in addition to the unit if applicable. Examples, - * request\_size\_bytes - * request\_size\_bytes\_total - * process\_cpu\_seconds - * process\_cpu\_seconds\_total -* ...that has a accumulating count such as `total`, can have two different naming scenarios. - * If the metric name has a unit, then the unit must be the last word before the accumulating count. Examples, - * process\_cpu\_seconds\_total - * request\_size\_bytes\_total - * If the metric name does'nt have a real unit, then the naming can follow any sorting order in a way that it fits your use case, such as `grouping similar metric names`. Examples, - * If you decided to name something as "net\_conntrack\_dialer\_conn", then it can have the following group names. (Note that this is only an example and you can follow your own order, if it improves your work flow) - * net\_conntrack\_dialer\_conn\_total - * net\_conntrack\_dialer\_conn\_failed\_total - * net\_conntrack\_dialer\_conn\_established\_total - * net\_conntrack\_dialer\_conn\_closed\_total - or - * net\_conntrack\_dialer\_conn\_total - * net\_conntrack\_dialer\_conn\_total\_failed - * net\_conntrack\_dialer\_conn\_total\_established - * net\_conntrack\_dialer\_conn\_total\_closed +* ...that has a accumulating count such as `total`, but doesn't have a base unit in the name like, "prometheus\_tsdb\_head\_truncations", then it can have the following naming scenarios. Note that the former examples would be suitable if you want to follow lexographic sorting order for the names. + * prometheus\_tsdb\_head\_truncations\_total + * prometheus\_tsdb\_head\_truncations\_failed\_total + * prometheus\_tsdb\_head\_truncations\_established\_total + * prometheus\_tsdb\_head\_truncations\_closed\_total + or + * prometheus\_tsdb\_head\_truncations\_total + * prometheus\_tsdb\_head\_failed\_truncations\_total + * prometheus\_tsdb\_head\_established\_truncations\_total + * prometheus\_tsdb\_head\_closed\_truncations\_total * ...should represent the same logical thing-being-measured across all label dimensions. * request duration