How jacksontj/promxy works
Project Type and Purpose
• Promxy is a backend proxy service (no UI) written in Go.
• Its purpose is to expose a single Prometheus‐compatible /api/v1 endpoint that federates/shards queries across multiple Prometheus servers (ServerGroups), merges results, and returns unified timeseries data. It also supports remote_write export of metrics.
File Structure Analysis
• cmd/
• promxy/ (main binary, config, demo files)
• remote_write_exporter/ (standalone exporter binary)
• pkg/ – core Go libraries, organized by function:
• config, logging, middleware (headers, instrumentation)
• promclient & promhttputil (HTTP client logic, query parsing)
• servergroup (definition of Prometheus clusters)
• proxyquerier & proxystorage (scatter-gather + merge logic)
• server (HTTP API handler, TLS config)
• remote & alertbackfill (remote_read/write queueing, alert rule merging)
• deploy/ – Dockerfiles, docker-compose, Kubernetes & Helm charts.
• test/ – integration & PromQL tests.
README Insights
• Promxy uses a “scatter-gather” approach: every query is issued to all configured servers, then merged.
• ServerGroup concept: logical grouping of identical Prometheus instances.
• Supports alerting/recording rules via remote_write.