(ch chan<- prometheus.Metric)
| 486 | } |
| 487 | |
| 488 | func (ma *MetricsAggregator) Collect(ch chan<- prometheus.Metric) { |
| 489 | output := make(chan []prometheus.Metric, 1) |
| 490 | |
| 491 | select { |
| 492 | case ma.collectCh <- output: |
| 493 | default: |
| 494 | ma.log.Error(context.Background(), "collect queue is full") |
| 495 | return |
| 496 | } |
| 497 | |
| 498 | for s := range output { |
| 499 | for _, m := range s { |
| 500 | ch <- m |
| 501 | } |
| 502 | } |
| 503 | } |
| 504 | |
| 505 | func (ma *MetricsAggregator) Update(ctx context.Context, labels AgentMetricLabels, metrics []*agentproto.Stats_Metric) { |
| 506 | select { |