Skip to content

Commit

Permalink
Document that Collect is concurrent-safe
Browse files Browse the repository at this point in the history
  • Loading branch information
pellared authored Jun 22, 2023
1 parent 87f5902 commit 60ce2f0
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions exporters/prometheus/exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@ func (c *collector) Describe(ch chan<- *prometheus.Desc) {
}

// Collect implements prometheus.Collector.
//
// This method is safe to call concurrently.
func (c *collector) Collect(ch chan<- prometheus.Metric) {
// TODO (#3047): Use a sync.Pool instead of allocating metrics every Collect.
metrics := metricdata.ResourceMetrics{}
Expand Down

0 comments on commit 60ce2f0

Please sign in to comment.