Initialize now fn for counters

Signed-off-by: Shreyas Srivatsan <shreyas@chronosphere.io>
This commit is contained in:
Shreyas Srivatsan 2020-02-05 22:24:29 -08:00
parent 76dd6c5819
commit bc9e50c39f
1 changed files with 1 additions and 1 deletions

View File

@ -180,7 +180,7 @@ func NewCounterVec(opts CounterOpts, labelNames []string) *CounterVec {
if len(lvs) != len(desc.variableLabels) { if len(lvs) != len(desc.variableLabels) {
panic(makeInconsistentCardinalityError(desc.fqName, desc.variableLabels, lvs)) panic(makeInconsistentCardinalityError(desc.fqName, desc.variableLabels, lvs))
} }
result := &counter{desc: desc, labelPairs: makeLabelPairs(desc, lvs)} result := &counter{desc: desc, labelPairs: makeLabelPairs(desc, lvs), now: time.Now}
result.init(result) // Init self-collection. result.init(result) // Init self-collection.
return result return result
}), }),