Small binary to modify any promql by adding any adhoc filter to any promql
Steps to use it:
- git clone [email protected]:pree-dew/promql_adhoc_filter.git
- go build .
- ./adhoc_filter 'input_promql' 'filters_to_add'
Example:
./adhoc_filter 'sum(rate(http_request_total{}[1m])) by (job, container) - sum(http{}) by (container)' '{"job": "test"}'
parsed expr: sum(http_request_total{job="test"}[1m]) by(job,container) - sum(http) by(container)