Repository navigation
Conversation
a080d34 to
1411e64
Compare
8db2179 to
59397b4
Compare
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>
59397b4 to
b865bfd
Compare
|
Proposed implementation of those modes in Prom: |
dashpole
left a comment
There was a problem hiding this comment.
This split makes sense to me
…tart_timestamp Signed-off-by: Bartek Plotka <bwplotka@gmail.com>
| * Use content type of `Content-Type: application/x-protobuf;proto=io.prometheus.write.v2.Request;mode=stateless`. | ||
| * Ensure all of the following for every `TimeSeries` in a `Request`: | ||
| * `Exemplar`s MUST only be sent on a `TimeSeries` that also contains at least one element in `samples` or in `histograms`. Exemplar-only `TimeSeries` messages MUST NOT be sent. | ||
| * Histograms MUST use the `Histogram` message (e.g. using Native Histograms with Custom Buckets instead of classic histogram `_bucket`, `_sum`, and `_count` float `Sample` series). |
There was a problem hiding this comment.
nit: if the type is not set, it's impossible to validate this, which questions the stateless name a little bit and the usefulness of this mode :(
There was a problem hiding this comment.
Well, not if we specify a clear heuristic e.g. _bucket, _sum, _count UNTYPED can be rejected. But yes, this is probably the biggest downside of this solution.
There was a problem hiding this comment.
_sum and _count can be summary as well, so nope. This is what we ran into when migrating to native histograms internally, we couldn't tell from PromQL queries alone what the type was, so we had to cross reference with the source code all the time.
There was a problem hiding this comment.
I'm a bit naive on this front, are summaries something we still want to support to the point that this would be a blocker beyond updating the spec to say they get dropped too if they are untyped?
| * Satisfy all `TimeSeries` requirements of [`stateless` mode](#stateless-mode). | ||
| * Ensure all of the following for every `TimeSeries` in a `Request`: | ||
| * `Metadata.type` MUST be specified and MUST NOT be `METRIC_TYPE_UNSPECIFIED` (`0`). | ||
| * `start_timestamp` MUST be set (non-zero) on every `Sample` and `Histogram` (except stale markers) for cumulative or delta metric types (`METRIC_TYPE_COUNTER`, `METRIC_TYPE_HISTOGRAM`, as well as `METRIC_TYPE_SUMMARY` `_sum` and `_count` `Samples`). |
There was a problem hiding this comment.
note: I'm unsure about this combined with metadata. As we said, maybe sending ST with every sample isn't a good idea for bandwidth when it comes to cumulative metrics. But I'm unsure about the actual overhead.
There was a problem hiding this comment.
Well, it's what some backends needs - true ST on cumulatives.
In Prometheus ecosystem I can imagine stateless + metric types (no ST) is the future (aka 3.0)
|
Practically, when a client sends the new Which means that the user needs to ask the admin of the receiver whether the check was actually performed. Consider returning |
…tion, and metric types Signed-off-by: Bartek Plotka <bwplotka@gmail.com>
I don't think we should add a response header for this:
|
| <!--- | ||
| Rationales: https://github.com/prometheus/proposals/blob/alexg/remote-write-20-proposal/proposals/2024-04-09_remote-write-20.md#no-new-compression-added--yet- | ||
| --> | ||
| Content encoding request header MUST follow [the RFC 9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-content-encoding). Senders MUST use the `snappy` value. Receivers MUST support `snappy` compression. New, optional compression algorithms might come in 2.x or beyond. |
There was a problem hiding this comment.
Do we want to do anything about opening up compression options for rc6 or leave that for a different RC?
There was a problem hiding this comment.
Yes, let's do in separate PR, can be in same RC, feel free to propose a PR
|
We decided to follow #3147 change instead |
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: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, so no exemplar-onlyTimeSeriesare sent.Histogrammessage, so classic histograms are 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 and 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.Why two progressive modes instead of one mode or separate capabilities?
statelessrules, attaching exemplars to samples or histograms and converting classic histograms to NHCB, are 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.stateless-typedincludesstatelessbecause receivers that require explicit metric types and start timestamps also require structured histograms and attached exemplars, and validatingstart_timestampalready requires knowingMetadata.type.default<stateless<stateless-typed) give 3 well-defined protocol states rather thanContent-Typematching to a single parameter value, and keepprometheus/compliancetesting linear.