Skip to main content
Prometheus remote-write decoders convert Prometheus remote-write protobuf payloads into Pinot rows during realtime ingestion. Use these decoders when your stream contains Prometheus 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.
Use the histogram decoder for:
  • Prometheus native histograms.
  • Histogram or summary-like remote-write payloads that need bucket spans and counts preserved.
Use separate Pinot tables for samples and histograms unless your upstream stream already separates those payloads.

Sample Decoder Schema

The sample decoder emits: Example schema:
Realtime table stream config:
Example query:

Histogram Decoder Schema

The histogram decoder preserves positive and negative bucket spans, bucket deltas, bucket counts, and zero-bucket metadata. Example schema:
Realtime table stream config:

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 time for common time-window queries.
  • Add an inverted index on name because 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 labels column for exploratory queries and long-tail labels.
Example optimized sample table field config:

Troubleshooting