PromQL Queries
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=1mpb promql run "up" --dataset otel_metrics --instantFlags
| Flag | Default | Description |
|---|---|---|
--dataset / -d | select-dataset | Metrics dataset to query |
--from / -f | 5m | Start of query window |
--to / -t | now | End of query window |
--step | auto | Resolution step for range queries |
--instant | false | Run as instant query instead of range |
--output / -o | text | Output format: text or json |
--interactive / -i | false | Open interactive TUI |
Interactive TUI
pb promql run -i
pb promql run "http_requests_total" --dataset otel_metrics --from=1h -iThe 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_metricsList all values for a specific label:
pb promql label-values job --dataset otel_metricsFind series matching a selector:
pb promql series --match 'http_requests_total' --dataset otel_metrics
pb promql series --match '{job="api-server"}' --dataset otel_metricsCardinality 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 20Series count per value for a specific label:
pb promql cardinality label-values --label job --dataset otel_metricsCurrently active series:
pb promql cardinality active-series --dataset otel_metrics --selector '{job="api"}'TSDB statistics
pb promql tsdb --dataset otel_metrics --top 10Shows storage statistics for the metrics dataset, broken down by the top N series by size.
Active queries
pb promql active-queries
pb promql psLists any PromQL queries currently running on the server. Useful for debugging slow or stuck queries.
Was this page helpful?