Skip to content

Commit 38444fe

Browse files
committed
Eval unit asap
Signed-off-by: Arianna Vespri <[email protected]>
1 parent 2efe1b8 commit 38444fe

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

prometheus/desc.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ func (v2) NewDesc(fqName, help string, variableLabels ConstrainableLabels, const
110110
for _, opt := range opts {
111111
opt(d)
112112
}
113+
unit := d.unit
113114
//nolint:staticcheck // TODO: Don't use deprecated model.NameValidationScheme.
114115
if !model.NameValidationScheme.IsValidMetricName(fqName) {
115116
d.err = fmt.Errorf("%q is not a valid metric name", fqName)
@@ -169,7 +170,7 @@ func (v2) NewDesc(fqName, help string, variableLabels ConstrainableLabels, const
169170
// label names.
170171
xxh.Reset()
171172
xxh.WriteString(help)
172-
xxh.WriteString(d.unit)
173+
xxh.WriteString(unit)
173174
xxh.Write(separatorByteSlice)
174175
for _, labelName := range labelNames {
175176
xxh.WriteString(labelName)

0 commit comments

Comments
 (0)