From a199184c14230ae23cb6edea6bc3b95b1a0fe924 Mon Sep 17 00:00:00 2001 From: Peter Jausovec Date: Mon, 19 Nov 2018 16:51:57 -0800 Subject: [PATCH] Update the label is not valid error message to include the fqName Fixes #504. Signed-off-by: Peter Jausovec --- prometheus/desc.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/prometheus/desc.go b/prometheus/desc.go index 7b8827ffb..1d034f871 100644 --- a/prometheus/desc.go +++ b/prometheus/desc.go @@ -93,7 +93,7 @@ func NewDesc(fqName, help string, variableLabels []string, constLabels Labels) * // First add only the const label names and sort them... for labelName := range constLabels { if !checkLabelName(labelName) { - d.err = fmt.Errorf("%q is not a valid label name", labelName) + d.err = fmt.Errorf("%q is not a valid label name for metric %q", labelName, fqName) return d } labelNames = append(labelNames, labelName) @@ -115,7 +115,7 @@ func NewDesc(fqName, help string, variableLabels []string, constLabels Labels) * // dimension with a different mix between preset and variable labels. for _, labelName := range variableLabels { if !checkLabelName(labelName) { - d.err = fmt.Errorf("%q is not a valid label name", labelName) + d.err = fmt.Errorf("%q is not a valid label name for metric %q", labelName, fqName) return d } labelNames = append(labelNames, "$"+labelName)