WriteRequest messages rather than JSON-like Prometheus records.
This page is different from the Prometheus Message Decoder, which documents the JSON-style
PrometheusMessageDecoder. Remote-write payloads use Prometheus protobuf wire format.Decoder Classes
Both decoders parse a Prometheus remote-write
WriteRequest, iterate through each time series, and emit multiple Pinot rows from one stream message.
When to Use
Use the sample decoder for:- Counters.
- Gauges.
- Prometheus time series where each data point is a timestamp/value sample.
- Prometheus native histograms.
- Histogram or summary-like remote-write payloads that need bucket spans and counts preserved.
Sample Decoder Schema
The sample decoder emits:
Example schema:
Histogram Decoder Schema
The histogram decoder preserves positive and negative bucket spans, bucket deltas, bucket counts, and zero-bucket metadata.
Example schema:
Output Behavior
Each remote-write message can contain many time series, and each time series can contain many samples or histograms. The decoders emit multiple rows from one input payload. Boundary safeguards:
The decoder extracts the metric name from the
__name__ label. If no __name__ label exists, or more than one exists, the row is emitted with a missing metric name and a warning is logged.
Labels are emitted as concatenated strings:
Modeling Tips
- Keep samples and histograms in separate tables unless you have a downstream reason to co-locate them.
- Use a sorted or timestamp index on
timefor common time-window queries. - Add an inverted index on
namebecause almost every query filters by metric name. - If you frequently filter by a small set of labels, consider extracting those labels upstream into dedicated Pinot columns.
- Keep the raw multi-value
labelscolumn for exploratory queries and long-tail labels.

