Skip to content

Commit

Permalink
Enable the queue for the Prometheus Remote Write Exporter internally (#…
Browse files Browse the repository at this point in the history
…2974)

* Enable queue for the Prometheus Remote Write Exporter internally

This is a follow up to #2951.

When we disable the queue completely, it causes the export to happen
not in a consumer goroutine. Enable the queue internally that export
gets its own goroutine not to block the entire collector pipeline.

* Set a default queue size
  • Loading branch information
rakyll authored Apr 21, 2021
1 parent ea77b8f commit 8476727
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions exporter/prometheusremotewriteexporter/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,13 @@ func createMetricsExporter(_ context.Context, params component.ExporterCreatePar
params.Logger,
prwe.PushMetrics,
exporterhelper.WithTimeout(prwCfg.TimeoutSettings),
exporterhelper.WithQueue(exporterhelper.QueueSettings{
Enabled: true,
NumConsumers: 1,
QueueSize: 10000,
// TODO(jbd): Adjust the default queue size
// and allow users to modify the queue size.
}),
exporterhelper.WithRetry(prwCfg.RetrySettings),
exporterhelper.WithShutdown(prwe.Shutdown),
)
Expand Down

0 comments on commit 8476727

Please sign in to comment.