Skip to content
This repository has been archived by the owner on Jun 21, 2022. It is now read-only.

canonical/promql-transform

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

⚠️ Deprecated

This tool has been deprecated in favor of cos-tool, which in addition to being able to everything this tool does, also is able to validate alert rules and expressions, as well as operate on logql expressions.

promql-transform

Transforms PromQL expressions on the fly

Usage

Given the expression

job:request_latency_seconds:mean5m{job=\"myjob\"} > 0.5

Running

$ ./promql-transform \
    --label-matcher juju_model=lma \
    --label-matcher juju_model_uuid=12345 \
    --label-matcher juju_application=proxy \
    --label-matcher juju_unit=proxy/1 \
    "job:request_latency_seconds:mean5m{job=\"myjob\"} > 0.5"

Would output

job:request_latency_seconds:mean5m{job="myjob",juju_application="proxy",juju_model="lma",juju_model_uuid="12345",juju_unit="proxy/1"} > 0.5