remotewrite/receiver: propose programmatic Receiver harness (mirrors sender) - #260
Open
om7057 wants to merge 1 commit into
Open
remotewrite/receiver: propose programmatic Receiver harness (mirrors sender)#260om7057 wants to merge 1 commit into
om7057 wants to merge 1 commit into
Conversation
om7057
marked this pull request as ready for review
August 11, 2026 18:13
bwplotka
force-pushed
the
feature/rw2senderfix
branch
2 times, most recently
from
August 12, 2026 10:05
ebdbd1f to
0380477
Compare
Member
|
Nice! I just updated the rw2sender branch, so you might want to update. But also we probably have to finish and get #256 merged so we can agree on the framework first. Will try to progress there |
…etheus#208) Ports the sender suite's programmatic pattern (Sender/RunTests/ComplianceTests, see remotewrite/sender) to the receiver side, so receiver compliance tests can be imported and run against a target Receiver implementation instead of being driven by an external config file + env vars. This converts metric_test.go's cases as a proof of concept (84 generated sub-cases) and adds a self-test that runs them against a downloaded Prometheus release binary. It intentionally lives at remotewrite/receiver/next rather than replacing remotewrite/receiver outright, to avoid breaking the existing suite while the design gets reviewed; if accepted, the remaining 9 files (combined, exemplar, histograms, metadata, request, rw1_compat) would be converted the same way and this would move up to replace remotewrite/receiver. One notable design deviation from sender: RunTests starts the receiver once per whole run rather than once per test case, since real receivers are too costly to restart per case and these tests only assert on the synchronous HTTP response to each write. Also note: remotewrite/receiver currently fails `go vet` on this branch (ts.CreatedTimestamp undefined) because the pinned prometheus/prometheus version predates writev2 start-timestamp support; the pending dependabot bump to v0.312.0 is a prerequisite for CreatedTimestamp-based cases. Signed-off-by: om7057 <kulkarniom7057@gmail.com>
om7057
force-pushed
the
receiver-programmatic-poc
branch
from
August 12, 2026 20:09
e3aa09b to
6ba4486
Compare
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Progresses #208 for the receiver side: this proposes converting
remotewrite/receiverfrom the current config-file + env-var drivenpackage maintest binary into an importable, programmatic package, mirroring theSender/RunTests/ComplianceTestspattern already landed forremotewrite/sender(#212).As a proof of concept, this converts
metric_test.go's three test functions (84 generated sub-cases) into the new declarative[]Test{...}shape, and adds aReceiverinterface +RunTestsharness + a self-test (prometheus_test.go) that downloads a Prometheus release binary and runs the converted suite against it end-to-end. Verified locally:go test ./remotewrite/receiver/next/...passes all 84 sub-cases against both a locally-built and a downloaded release binary.Why staged at
remotewrite/receiver/nextinstead of replacingremotewrite/receiverThe remaining 9 files (
combined_test.go,exemplar_test.go,histograms_test.go,metadata_test.go,request_test.go,rw1_compat_test.go, plus retiringmain_test.go/helpers_test.go) still need conversion — roughly 2,300 more lines. Rather than doing that speculatively, I'd like early feedback on the API shape first, so this intentionally sits alongside the existing suite (which keeps working) rather than replacing it. If the design is accepted, I'll convert the rest and movenext/up to replaceremotewrite/receiver.Design questions for reviewers
sender.sender.RunTestsrestarts a fresh sender subprocess per test case (cheap — the mock scrape target/receiver are in-process). A receiver under test (e.g. a full Prometheus binary) is too costly to restart per case, and since these tests only assert on the synchronous HTTP response to each write (status +X-Prometheus-Remote-Write-*-Writtenheaders), never a follow-up query, I start the receiver once for the wholeRunTestscall and send all cases at it sequentially — matching the current suite'sTestMain-once behaviour. Open to alternatives if this is wrong.ReceiverperRunTestscall, matchingsender's shape. Should the caller just callRunTestsonce per receiver instead (simplest), or does something depend on the single-run multi-receiver behaviour?PROMETHEUS_RW2_COMPLIANCE_READY_TIMEOUTenv var (default 3m) since a receiver may need to download/build a binary before responding — happy to align naming withsender'sPROMETHEUS_RW2_COMPLIANCE_TEST_TIMEOUTif preferred.Known blocker unrelated to this PR
remotewrite/receiver(the existing, untouched suite) currently failsgo vet/go buildon this branch as-is:ts.CreatedTimestamp undefined, because the pinnedgithub.com/prometheus/prometheus(v0.307.4) predateswritev2.TimeSeriesstart-timestamp support. There's already a dependabot branch (dependabot/go_modules/remotewrite/receiver/github.com/prometheus/prometheus-0.312.0) that should fix this — flagging in case it wasn't noticed, since it also meansCreatedTimestampis stubbed out (no-op) in this PR'srequest.gountil that lands.