Skip to main content
Prometheus is a widely-used open-source monitoring and alerting toolkit that collects and stores time series data from various sources. The Prometheus Message Decoder in Pinot provides native support for ingesting Prometheus-formatted metrics data into pinot tables.

Prometheus Message Format

This format encapsulates the four main components of our schema:
  • <metric_name> corresponds to the metric field (STRING)
  • {<label1>=<value1>,<label2>=<value2>,...} represents the labels field (JSON)
  • <metric_value> maps to the value field (DOUBLE)
  • <timestamp> corresponds to the ts field (TIMESTAMP)

Table schema

  • The schema created for ingesting Prometheus metrics MUST adhere to the format specified above, particularly with respect to the field names and data types.
  • If you require different field names in your Pinot table, you can add transform functions to alias the names.
    • However, the incoming data must match this specified schema for the Prometheus Message Decoder to function correctly.

Schema Configuration

Configuration Example

When ingesting a Prometheus Message formatted payload from a stream, the decoder used for the stream must be ai.startree.pinot.plugin.inputformat.prometheus.PrometheusMessageDecoder
In the above sample, the Kafka consumer factory used is org.apache.pinot.plugin.stream.kafka20.KafkaConsumerFactory and the decoder associated with this stream is ai.startree.pinot.plugin.inputformat.prometheus.PrometheusMessageDecoder".