Skip to content

Commit ff01778

Browse files
author
beorn7
committed
Be more precise about concurrency requirements
Signed-off-by: beorn7 <[email protected]>
1 parent 7eb5e8a commit ff01778

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

prometheus/collector.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ type Collector interface {
4040
// Collector may yield any Metric it sees fit in its Collect method.
4141
//
4242
// This method idempotently sends the same descriptors throughout the
43-
// lifetime of the Collector.
43+
// lifetime of the Collector. It may be called concurrently and
44+
// therefore must be implemented in a concurrency safe way.
4445
//
4546
// If a Collector encounters an error while executing this method, it
4647
// must send an invalid descriptor (created with NewInvalidDesc) to

prometheus/registry.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,6 @@ type Registerer interface {
107107
// Collector, and for providing a Collector that will not cause
108108
// inconsistent metrics on collection. (This would lead to scrape
109109
// errors.)
110-
//
111-
// It is in general not safe to register the same Collector multiple
112-
// times concurrently.
113110
Register(Collector) error
114111
// MustRegister works like Register but registers any number of
115112
// Collectors and panics upon the first registration that causes an

0 commit comments

Comments
 (0)