Parseable

PromQL Queries

Query metrics datasets in Parseable using PromQL.


Parseable can store metrics data ingested via OpenTelemetry or Prometheus remote write. The pb promql commands let you query, explore, and analyze those metrics from the terminal.

Run a PromQL query

pb promql run "<expr>" --dataset <metrics-dataset> --from <duration>
pb promql run "rate(http_requests_total[5m])" --dataset otel_metrics --from=1h --step=1m
pb promql run "up" --dataset otel_metrics --instant

Flags

FlagDefaultDescription
--dataset / -dselect-datasetMetrics dataset to query
--from / -f5mStart of query window
--to / -tnowEnd of query window
--stepautoResolution step for range queries
--instantfalseRun as instant query instead of range
--output / -otextOutput format: text or json
--interactive / -ifalseOpen interactive TUI

Interactive TUI

pb promql run -i
pb promql run "http_requests_total" --dataset otel_metrics --from=1h -i

The TUI has panels for dataset, query expression, time range, step size, and results. Navigate with Tab / Shift+Tab, run with Ctrl+R, and press Space on the step panel to toggle between range and instant mode.

The PromQL TUI also includes a builder flow for exploring metrics, labels, and values from the selected dataset before inserting an expression.

Explore labels and series

List all label names in a metrics dataset:

pb promql labels --dataset otel_metrics

List all values for a specific label:

pb promql label-values job --dataset otel_metrics

Find series matching a selector:

pb promql series --match 'http_requests_total' --dataset otel_metrics
pb promql series --match '{job="api-server"}' --dataset otel_metrics

Cardinality analysis

High cardinality labels are a common cause of performance issues. These commands help you find them.

Labels with the most distinct values:

pb promql cardinality label-names --dataset otel_metrics --limit 20

Series count per value for a specific label:

pb promql cardinality label-values --label job --dataset otel_metrics

Currently active series:

pb promql cardinality active-series --dataset otel_metrics --selector '{job="api"}'

TSDB statistics

pb promql tsdb --dataset otel_metrics --top 10

Shows storage statistics for the metrics dataset, broken down by the top N series by size.

Active queries

pb promql active-queries
pb promql ps

Lists any PromQL queries currently running on the server. Useful for debugging slow or stuck queries.

Was this page helpful?

On this page