mr-karan
prom2grafana
HTML

Convert Prometheus metrics to Grafana dashboards and alert rules using AI

Last updated May 26, 2026
79
Stars
3
Forks
1
Issues
0
Stars/day
Attention Score
15
Language breakdown
No language data available.
Files click to expand
README

prom2grafana

A web application that intelligently converts raw Prometheus metrics into production-ready Grafana dashboards and alert rules using AI.

Features

  • 🚀 Instant Conversion - Paste Prometheus metrics, get a complete Grafana dashboard
  • 🎯 Smart Panel Generation - AI creates appropriate visualizations for each metric type
  • Alert Rules - Automatically generates Prometheus alert rules based on metrics
  • 🎨 Clean UI - Minimal, focused interface with real-time conversion
  • 📋 Export Ready - Copy JSON directly or download dashboard files

Demo

🚀 Try it live at prom2grafana.mrkaran.dev

prom2grafana demo

Installation

Using Go

go install github.com/mr-karan/prom2grafana@latest

Using Docker

docker run -p 8080:8080 -e OPENAIAPIKEY=your_key ghcr.io/mr-karan/prom2grafana

From Source

git clone https://github.com/mr-karan/prom2grafana.git
cd prom2grafana
go mod download
go build -o prom2grafana

Usage

  • Set your OpenRouter API key:
export OPENAIAPIKEY=youropenrouterapi_key
  • Run the server:
./prom2grafana
  • Open http://localhost:8080 in your browser
  • Paste your Prometheus metrics and click "Generate Dashboard"
  • Copy the generated Grafana dashboard JSON and import it into Grafana

Configuration

The application can be configured using environment variables:

  • OPENAIAPIKEY - Your OpenRouter API key (required)
  • PORT - Server port (default: 8080)
  • LOG_LEVEL - Log level: debug, info, warn, error (default: info)

Example Input

# HELP nodecpuseconds_total Seconds the CPUs spent in each mode.

TYPE nodecpuseconds_total counter

nodecpuseconds_total{cpu="0",mode="idle"} 425836.82 nodecpuseconds_total{cpu="0",mode="iowait"} 52.34

HELP nodememoryMemAvailablebytes Memory information field MemAvailablebytes.

TYPE nodememoryMemAvailable_bytes gauge

nodememoryMemAvailable_bytes 1.648762880e+10

Development

# Install dependencies
go mod tidy

Run with hot reload

air

Run tests

go test ./...

Build

just build

Release

just release

Tech Stack

  • Backend: Go with net/http
  • Frontend: Vanilla HTML/CSS/JS
  • AI: Google Gemini 2.0 Flash via OpenRouter
  • Deployment: Single binary with embedded assets

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

MIT License - see LICENSE file for details

Author

mr-karan

🔗 More in this category

© 2026 GitRepoTrend · mr-karan/prom2grafana · Updated daily from GitHub