PromQL parser and executor for TSBS DevOps query patterns.
Parses PromQL expressions used by TSBS's VictoriaMetrics adapter into a structured query plan, then routes to the appropriate TimelessMetrics query function.
Supported patterns
# Simple selector
cpu_usage_user{hostname="host_0"}
# Regex label matching
cpu_usage_user{hostname=~"host_0|host_1"}
# Range vector with function
max_over_time(cpu_usage_user{hostname="host_0"}[1h])
# Outer aggregation with group-by
max(max_over_time(cpu_usage_user{hostname=~"host_0|host_1"}[1h])) by (hostname)
# Threshold
max(max_over_time(cpu_usage_user{hostname="host_0"}[1h])) by (hostname) > 90
# Multi-metric with regex __name__
max(max_over_time({__name__=~"cpu_.*",hostname=~"host_0"}[1h])) by (hostname)
Summary
Functions
Execute a parsed PromQL plan against a store.
Parse a PromQL query string into a structured query plan.