Skip to content

feat(output): prometheus-remote-write push output, RW 1.0 and 2.0 (PIPE-1487, BP-470) - #320

Open
Dylan-M wants to merge 2 commits into
dylanmyers/pipe-1486-prometheus-metric-mapping-package-sharedfrom
dylanmyers/pipe-1487-prometheus-remote-write-output-push-client
Open

Dylan-M wants to merge 2 commits into
dylanmyers/pipe-1486-prometheus-metric-mapping-package-sharedfrom
dylanmyers/pipe-1487-prometheus-remote-write-output-push-client

Conversation

@Dylan-M

@Dylan-M Dylan-M commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Proposed Change

Adds a prometheus-remote-write output: a metrics-only push client that sends remote-write payloads to a configured endpoint. Remote-write 1.0 and 2.0 are both supported.

Checklist
  • Changes are tested
  • CI has passed

@Dylan-M
Dylan-M requested review from a team as code owners September 24, 2026 16:34
@Dylan-M
Dylan-M force-pushed the dylanmyers/pipe-1487-prometheus-remote-write-output-push-client branch from f73ea85 to 606ad61 Compare September 24, 2026 16:43
@Dylan-M Dylan-M changed the title feat(output): prometheus-remote-write push output, RW 1.0 and 2.0 (PIPE-1487, BP-348) feat(output): prometheus-remote-write push output, RW 1.0 and 2.0 (PIPE-1487, BP-470) Sep 25, 2026
Comment thread output/promrw/promrw.go Outdated

// flush snapshots the buffered series under the lock, then encodes and POSTs
// them outside the lock so the HTTP round-trip never blocks writers.
func (o *Output) flush(ctx context.Context) error {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A flush can run from WriteMetric and from the timer loop at the same time, so two POSTs race. The newer one can land first, and Prometheus then rejects the older batch with 400: out of order sample for series {name="system_memory_utilization"}.
Also, a failed batch is dropped with no retry on 429/5xx.

@Dylan-M
Dylan-M force-pushed the dylanmyers/pipe-1487-prometheus-remote-write-output-push-client branch from 606ad61 to 5f0c352 Compare September 28, 2026 18:09
@Dylan-M
Dylan-M requested a review from eKuG September 28, 2026 18:09
Comment thread output/promrw/promrw.go
}

o.mu.Lock()
o.buf = append(o.buf, e)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because the fix now retries, the buffer has no upper bound. WriteMetric appends to o.buf and never blocks, while the sender can spend minutes retrying a single batch. With the endpoint returning 429 + Retry-After: 1, the unsent backlog grew by about 19k series per second: 113,500 after 6 s, with one POST per second.

@eKuG
eKuG added this pull request to stack #326 September 28, 2026 18:41

This branch has not been deployed

No deployments
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.

2 participants