From 30b28de9756404cbf3a9672dab7aee60a1c0582c Mon Sep 17 00:00:00 2001 From: Ziqi Zhao Date: Sat, 9 Jul 2022 21:39:54 +0800 Subject: [PATCH] add queue capacity metric for experimental query setting Signed-off-by: Ziqi Zhao --- exporter/exporterhelper/queued_retry_experimental.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/exporter/exporterhelper/queued_retry_experimental.go b/exporter/exporterhelper/queued_retry_experimental.go index 30aadebfeb3..a808e212c71 100644 --- a/exporter/exporterhelper/queued_retry_experimental.go +++ b/exporter/exporterhelper/queued_retry_experimental.go @@ -219,6 +219,12 @@ func (qrs *queuedRetrySender) start(ctx context.Context, host component.Host) er if err != nil { return fmt.Errorf("failed to create retry queue size metric: %w", err) } + err = globalInstruments.queueCapacity.UpsertEntry(func() int64 { + return int64(qrs.cfg.QueueSize) + }, metricdata.NewLabelValue(qrs.fullName())) + if err != nil { + return fmt.Errorf("failed to create retry queue capacity metric: %w", err) + } } return nil