Repository navigation
Conversation
Define two progressive modes for io.prometheus.write.v2.Request: stateless (requiring Exemplars attached to samples/histograms and Histogram messages for histograms) and stateless-typed (extending stateless with mandatory Metadata.type and start_timestamp on cumulative/delta metric types). Signed-off-by: Bartek Plotka <bwplotka@gmail.com>
bwplotka
force-pushed
the
bwplotka/rw2-rc6-two-modes
branch
from
October 16, 2026 15:49
a080d34 to
1411e64
Compare
dashpole
self-requested a review
October 16, 2026 16:02
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.
Alternative to #3129.
Specify two progressive modes (
statelessandstateless-typed) forio.prometheus.write.v2.Requestin Remote-Write2.0-rc.6, following the Prometheus Dev Summit consensus and RFC 9413.By default, when no
;mode=parameter is set onContent-Type: application/x-protobuf;proto=io.prometheus.write.v2.Request, all field permutations permitted by the base specification may be sent.2.0-rc.6adds two optional, progressive modes where sendersMUSTguarantee (and receiversCANexpect):statelessmode (Content-Type: application/x-protobuf;proto=io.prometheus.write.v2.Request;mode=stateless):Exemplars are attached to aTimeSeriesthat contains at least one sample or histogram (no exemplar-onlyTimeSeries).Histogrammessage (classic histograms must be sent as NHCB instead of_bucket,_sum, and_countfloat series).stateless-typedmode (Content-Type: application/x-protobuf;proto=io.prometheus.write.v2.Request;mode=stateless-typed):statelessmode.Metadata.typeis set (notMETRIC_TYPE_UNSPECIFIED).start_timestampis set (non-zero) on every sample and histogram for cumulative and delta metric types (METRIC_TYPE_COUNTER,METRIC_TYPE_HISTOGRAM, andMETRIC_TYPE_SUMMARY_sumand_count).Both modes are optional for senders and receivers and remain valid
io.prometheus.write.v2.Requestpayloads on the wire.Receiver acceptance and violation rules
MUST NOTrejectTimeSeriesfor omitting fields only required by a stricter mode (for example, a Receiver acceptingmode=statelessmust accept series withMETRIC_TYPE_UNSPECIFIEDorstart_timestamp = 0; if it requires those fields, it must requiremode=stateless-typedand return415 HTTP Unsupported Media Typefor lower modes).400 HTTP Bad Request): If a request violates the mode specified in itsContent-Typeheader, ReceiversMUSTtreat the violatingTimeSeriesas invalid samples and return400 HTTP Bad Request(either rejecting the entire request or writing the validTimeSeriesfollowing partial write rules).Why two progressive modes instead of one mode or separate capabilities?
Sender formatting vs. upstream instrumentation boundary:
statelessrules (attaching exemplars to samples/histograms and converting classic histograms to NHCB) are pure sender-side formatting choices. Any sender (such as Prometheus or Alloy) can enforce them by configuration alone without dropping data, even when scraping legacy targets.stateless-typedrules (Metadata.typeandstart_timestamp) require every series to have a known metric type and counter start time. When scraping targets that expose untyped metrics or omit_createdtimestamps, a sender can only satisfystateless-typedby synthesizing state, inferring types, or dropping non-conforming series.statelessmode while giving strict OpenTelemetry/typed receivers (stateless-typed) the full contract they need.Why
stateless-typedincludesstateless(keepingmode=instead ofcapabilities=):start_timestampalready requires knowingMetadata.type, and receivers that require explicit metric types and start timestamps also require structured histograms and attached exemplars.default<stateless<stateless-typed) give 3 well-defined protocol states rather thanContent-Typematching to a single parameter value, and keepprometheus/compliancetesting linear.