A Chrome extension that helps you format PromQL queries to make them more readable. Based on the official Prometheus parser library compiled to WebAssembly via o11y.tools.
- Format PromQL queries directly in your browser
- No server required, all processing happens locally
- Manually format queries through the extension popup
- Click the extension icon in the toolbar to open the popup
- Enter your PromQL query in the text box
- Click the "Format" button
- Copy the formatted query using the "Copy Result" button
- Clone this repository:
git clone https://github.com/xhinliang/promql-formatter.git - Install dependencies:
npm install - Build the WebAssembly component:
npm run build - Open Chrome and navigate to
chrome://extensions/ - Enable "Developer mode" in the top-right corner
- Click "Load unpacked" and select the project folder
This project uses a Go-based PromQL parser compiled to WebAssembly for the formatting functionality.
custom-promql-parser/- Go code for the PromQL parserimages/- Extension icons*.jsfiles - Chrome extension JavaScript code*.htmlfiles - Extension UIbuild.sh- Script to build the WebAssembly component
npm run build- Build the WebAssembly componentnpm run lint- Run ESLint to check for code issuesnpm run lint:fix- Automatically fix ESLint issues
This extension does not collect or send any data to external servers. All query processing is done locally in your browser.
This extension is licensed under the Apache 2.0 License.
Special thanks to o11y.tools for providing the PromQL parser that uses the official Prometheus library compiled to WebAssembly.