From fe28f324334766f678a30c32ea83a9e1b52d3b69 Mon Sep 17 00:00:00 2001 From: beorn7 Date: Fri, 14 Sep 2018 11:59:13 +0200 Subject: [PATCH] Discourage prefixing every metris with WrapRegistererWithPrefix Signed-off-by: beorn7 --- prometheus/wrap.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/prometheus/wrap.go b/prometheus/wrap.go index b967fc0..49159bf 100644 --- a/prometheus/wrap.go +++ b/prometheus/wrap.go @@ -47,7 +47,13 @@ func WrapRegistererWith(labels Labels, reg Registerer) Registerer { // // WrapRegistererWithPrefix is useful to have one place to prefix all metrics of // a sub-system. To make this work, register metrics of the sub-system with the -// wrapping Registerer returned by WrapRegistererWithPrefix. +// wrapping Registerer returned by WrapRegistererWithPrefix. It is rarely useful +// to use the same prefix for all metrics exposed. In particular, do not prefix +// metric names that are standardized across applications, as that would break +// horizontal monitoring, for example the metrics provided by the Go collector +// (see NewGoCollector) and the process collector (see NewProcessCollector). (In +// fact, those metrics are already prefixed with “go_” or “process_”, +// respectively.) func WrapRegistererWithPrefix(prefix string, reg Registerer) Registerer { return &wrappingRegisterer{ wrappedRegisterer: reg,