Remove outdated use-case description from doc comment

We stopped advertising binary-wide setting of a label quite a while
ago. This doc comment was missed in the cleanup.

Signed-off-by: beorn7 <bjoern@rabenste.in>
This commit is contained in:
beorn7 2019-05-16 11:23:48 +02:00
parent 2827f2a8d9
commit e91cd81632
1 changed files with 5 additions and 10 deletions

View File

@ -232,16 +232,11 @@ func ExampleRegister() {
// A different (and somewhat tricky) approach is to use // A different (and somewhat tricky) approach is to use
// ConstLabels. ConstLabels are pairs of label names and label values // ConstLabels. ConstLabels are pairs of label names and label values
// that never change. You might ask what those labels are good for (and // that never change. Each worker creates and registers an own Counter
// rightfully so - if they never change, they could as well be part of // instance where the only difference is in the value of the
// the metric name). There are essentially two use-cases: The first is // ConstLabels. Those Counters can all be registered because the
// if labels are constant throughout the lifetime of a binary execution, // different ConstLabel values guarantee that each worker will increment
// but they vary over time or between different instances of a running // a different Counter metric.
// binary. The second is what we have here: Each worker creates and
// registers an own Counter instance where the only difference is in the
// value of the ConstLabels. Those Counters can all be registered
// because the different ConstLabel values guarantee that each worker
// will increment a different Counter metric.
counterOpts := prometheus.CounterOpts{ counterOpts := prometheus.CounterOpts{
Subsystem: "worker_pool", Subsystem: "worker_pool",
Name: "completed_tasks", Name: "completed_tasks",