0.5 Running " /> 0.5 Running " /> 0.5 Running "/>

Transform PromQL Expressions on the fly

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
Similar Resources

Kana - Simple discord bot for generate code snippet on the fly

Kana - Simple discord bot for generate code snippet on the fly

kana discord bot for generate code snippet on the fly, made with graphene Invite

Jan 25, 2022

Asset storage and on-the-fly image resize

air - Asset & Image Resize Asset storage and on-the-fly image resize powered by libvips. Uploading an asset $ http -f POST http://127.0.0.1:1323/uploa

Feb 5, 2022

Dbt-postgres-proxy - Proxy server which intercepts and compiles dbt queries on the fly

Dbt-postgres-proxy - Proxy server which intercepts and compiles dbt queries on the fly

dbt-postgres-proxy A reverse proxy for postgres which compiles queries in flight

Mar 4, 2022

Litestream-read-replica-demo - A demo application for running live read replication on fly.io with Litestream

Litestream Read Replica Demo A demo application for running live read replicatio

Oct 18, 2022

🍫 A collection of common regular expressions for Go

CommonRegex A collection of often used regular expressions for Go Inspired by CommonRegex This is a collection of often used regular expressions. It p

Dec 31, 2022

A tool and library for using structural regular expressions.

Structural Regular Expressions sregx is a package and tool for using structural regular expressions as described by Rob Pike (link).

Dec 7, 2022

A command-line tool and library for generating regular expressions from user-provided test cases

A command-line tool and library for generating regular expressions from user-provided test cases

Table of Contents What does this tool do? Do I still need to learn to write regexes then? Current features How to install? 4.1 The command-line tool 4

Jan 9, 2023

A command-line runner for Go expressions

grun grun is a command-line tool for evaluating Go expressions. It was inspired by runner which does the same for Rust. It constructs a little Go prog

Feb 10, 2022

A simple evaluator for arithmetic integer expressions.

The expr package provides a simple evaluator for arithmetic integer expressions. The syntax and operations are the same as in Go. Operands are the nat

Dec 13, 2022

A commandline tool to resolve URI Templates expressions as specified in RFC 6570.

URI Are you tired to build, concat, replace URL(s) (via shell scripts sed/awk/tr) from your awesome commandline pipeline? Well! here is the missing pi

Jun 9, 2021

Compile Go regular expressions to Go code

regexp2go regexp2go is an alternate backend for the regexp package that allows to perform ahead-of-time compilation of regular expressions to Go code.

Jul 11, 2022

A small & fast dependency-free library for parsing micro expressions.

MicroExpr A small & fast dependency-free library for parsing micro expressions. This library was originally built for use in templating languages (e.g

Nov 25, 2022

Machine-readable regular expressions for identifying accession numbers for cultural heritage organizations in text.

Machine-readable regular expressions for identifying accession numbers for cultural heritage organizations in text.

Jun 14, 2022

Converts NFAs (and DFAs) to a regular expressions using the state removal method.

nfa-to-regex: convert NFAs (and DFAs) to regular expressions An implementation of the state removal technique for converting an NFA to a regular expre

Apr 29, 2022

Converts NFAs (and DFAs) to a regular expressions using the state removal method

nfa2regex: convert NFAs (and DFAs) to regular expressions An implementation of the state removal technique for converting an NFA to a regular expressi

Apr 29, 2022

A library to read, write, and transform Stereolithography (.stl) files in Go.

stl A library to read, write, and transform Stereolithography (.stl) files in Go. It is used in the command line STL manipulation tool stltool. Featur

Sep 26, 2022

omniparser: a native Golang ETL streaming parser and transform library for CSV, JSON, XML, EDI, text, etc.

omniparser: a native Golang ETL streaming parser and transform library for CSV, JSON, XML, EDI, text, etc.

omniparser Omniparser is a native Golang ETL parser that ingests input data of various formats (CSV, txt, fixed length/width, XML, EDI/X12/EDIFACT, JS

Jan 4, 2023

Helper library to transform TMX tile maps into a simpler format for Ebiten

Ebitmx Ebitmx is a super simple parser to help render TMX maps when using Ebiten for your games. Right now is super limited to XML and CSV data struct

Nov 16, 2022

OctoSQL is a query tool that allows you to join, analyse and transform data from multiple databases and file formats using SQL.

OctoSQL is a query tool that allows you to join, analyse and transform data from multiple databases and file formats using SQL.

OctoSQL OctoSQL is a query tool that allows you to join, analyse and transform data from multiple databases, streaming sources and file formats using

Dec 29, 2022
Comments
  • Update vendored deps so we get the most recent prometheus functions

    Update vendored deps so we get the most recent prometheus functions

    Issue

    promql-transform cannot currently recognize last_over_time() and probably some other functions.

    Solution

    Update the vendored deps.

    Release Notes

    Update to the latest version of github.com/prometheus/prometheus/promql

  • Use a matrix to check and push to multiple charms

    Use a matrix to check and push to multiple charms

    Issue

    Expand the github workflows so they automatically publish resources to any charm which needs it.

    Solution

    Use a matrix in the workflow instead of hardcoding prometheus only

    Release Notes

    Automatically publish resources to more charms than just prometheus

  • Fix linebreak and matcher bugs

    Fix linebreak and matcher bugs

    resolves #1 resolves #2

    Issue

    promql-transform currently is able to create expressions that are unable to match anything. it also outputs an unnecessary trailing line break that makes the output YAML look uglier than needed.

    Solution

    Check for existing label matchers and skip if there is a collision.

    Context

    N/A

    Testing Instructions

    • Run promql-transform with a label matcher already present in the expression and make sure it's not added.
    • Mix present and new label matchers and make sure the new ones are added
    • Verify there is no line break at the end of the output.

    Release Notes

    • Fixes an issue where adding label matchers already present would result in two matchers for the same name, making the expression not match anything.
    • Fixes an issue where mutated expressions would get an unnecessary trailing line break.
  • Publish new amd64 and arm64 revisions on merge to main

    Publish new amd64 and arm64 revisions on merge to main

    Issue

    Automate releases of promql-transform on merges to main, including the upload of new resource revisions to CharmHub for the prometheus-k8s charm.

    Solution

    On merges to main:

    1. Create a new tag, based on the latest CharmHub revision number, incremented by one
    2. Create a new GitHub release with, as artefacts, both the amd64 and arm64 binaries
    3. Publishes the amd64 and arm64 binaries as new revisions in CharmHub for the promql-transform-{amd|arm}64 resources for the prometheus-k8s charm

    This new build process needs a CHARMHUB_TOKEN secret set as a repository secret with the output of charmcraft login --export.

    Context

    • Goreleaser needs SemVer in tags, so we could not use it (I wanted to keep the tagging semantic in line with CharmHub revisions for clarity).

    Testing Instructions

    For the repo. Let the build run without a CHARMHUB_TOKEN. Check the created git tag, GitHub release and binaries, which are attached as build artefacts.

    Release Notes

    • Automated the release process
Converts NFAs (and DFAs) to a regular expressions using the state removal method

nfa2regex: convert NFAs (and DFAs) to regular expressions An implementation of the state removal technique for converting an NFA to a regular expressi

Apr 29, 2022
A proxy that authorizes and enforces a given label in a given PromQL query

prom-authzed-proxy prom-authzed-proxy is a proxy for Prometheus that authorizes the request's Bearer Token with Authzed and enforces a label in a Prom

Jul 19, 2022
PromQL Prettier

PromQL Prettier Have trouble in reading PromQL written by your colleagues or SRE team? promql-prettier to the rescue! Thanks for WebAssembly, you can

Sep 5, 2022
Node Native MetricsQL/PromQL Parser
Node Native MetricsQL/PromQL Parser

node-metricsql Native node binding for MetricsQL Parser Build Module make Usage const metricsql = require('node-metricsql'); const parsed = metricsql.

Dec 24, 2022
Convert Golang Struct To GraphQL Object On The Fly

Straf Convert Golang Struct To GraphQL Object On The Fly Easily Create GraphQL Schemas Example Converting struct to GraphQL Object type UserExtra stru

Oct 26, 2022
:link: Generate HTML and CSS together, on the fly
:link: Generate HTML and CSS together, on the fly

On The Fly Package for generating HTML and CSS together, on the fly. Can also be used for generating HTML, XML or CSS (or templates). HTML and CSS can

Oct 12, 2022
This library generate a new tlsconfig usable within go standard library configured with a self-signed certificate generated on the fly

sslcert This library generate a new tlsconfig usable within go standard library configured with a self-signed certificate generated on the fly. Exampl

Dec 17, 2022
The f stands for fly

fhttp NOTE This maintenance of this library has move over to userflynet. The only use for this repository is so imports will not break. The f stands f

Dec 19, 2022
Create inlets servers on fly.io

inlets-on-fly inlets-on-fly automates the task of creating an inlets-pro exit-server (tunnel server) on the fly.io platform. This automation started a

Dec 1, 2022