Skip to content

Conversation

@cnygaard
Copy link

@cnygaard cnygaard commented Dec 2, 2025

Implement per-destination buffered queues for loki.process, loki.relabel, and loki.secretfilter components to prevent a slow or blocked downstream receiver from blocking log delivery to other destinations.

Key changes:

  • Each downstream destination gets its own buffered queue with a dedicated worker goroutine, ensuring FIFO ordering while preventing head-of-line blocking

  • Configurable queue size via max_forward_queue_size (default: 100,000 entries per destination)

  • Optional block_on_full mode (default: false):

    • false: drop entries when queue is full (non-blocking)
    • true: retry with exponential backoff (5ms to 5s max)
  • New metrics for observability:

    • *_dropped_entries_total: entries dropped due to full queue
    • *_enqueue_retries_total: retry attempts when block_on_full=true

Fixes: #2194

PR Description

Which issue(s) this PR fixes

2194

Notes to the Reviewer

PR Checklist

  • [] CHANGELOG.md updated
  • Documentation added
  • Tests updated
  • Config converters updated

Implement per-destination buffered queues for loki.process, loki.relabel,
and loki.secretfilter components to prevent a slow or blocked downstream
receiver from blocking log delivery to other destinations.

Key changes:

- Each downstream destination gets its own buffered queue with a
  dedicated worker goroutine, ensuring FIFO ordering while preventing
  head-of-line blocking

- Configurable queue size via max_forward_queue_size (default: 100,000
  entries per destination)

- Optional block_on_full mode (default: false):
  - false: drop entries when queue is full (non-blocking)
  - true: retry with exponential backoff (5ms to 5s max)

- New metrics for observability:
  - *_dropped_entries_total: entries dropped due to full queue
  - *_enqueue_retries_total: retry attempts when block_on_full=true

Fixes: grafana#2194
Add documentation for the new max_forward_queue_size and block_on_full
arguments in loki.process, loki.relabel, and loki.secretfilter.

Update CHANGELOG.md with the bugfix entry.
@CLAassistant
Copy link

CLAassistant commented Dec 2, 2025

CLA assistant check
All committers have signed the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

loki.process forwarding to multiple components blocks all destinations if one is blocked

2 participants