Skip to content

Commit

Permalink
Initialize now fn for counters
Browse files Browse the repository at this point in the history
Signed-off-by: Shreyas Srivatsan <shreyas@chronosphere.io>
  • Loading branch information
shreyassrivatsan committed Feb 6, 2020
1 parent 76dd6c5 commit bc9e50c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion prometheus/counter.go
Expand Up @@ -180,7 +180,7 @@ func NewCounterVec(opts CounterOpts, labelNames []string) *CounterVec {
if len(lvs) != len(desc.variableLabels) {
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.
return result
}),
Expand Down

0 comments on commit bc9e50c

Please sign in to comment.