Skip to content

Commit

Permalink
Update the label is not valid error message to include the fqName
Browse files Browse the repository at this point in the history
Fixes prometheus#504.

Signed-off-by: Peter Jausovec <[email protected]>
  • Loading branch information
Peter Jausovec committed Nov 20, 2018
1 parent 3fb53df commit a199184
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions prometheus/desc.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down

0 comments on commit a199184

Please sign in to comment.