Ridley is a small Go service intended to receive Prometheus remote_write traffic from multiple Prometheus replicas in an HA configuration with the identical scrape targets and de-duplicate the metrics by only forwarding from a single replica at a time. The repository includes a sample configuration and a prometheus/ folder with example Prometheus instances and a Docker Compose setup for local testing.
Notable files
ridley-config.yaml: example configuration used by the service.remote_write_handler.go: code that handles Prometheus remote_write requests.conntracker.go: connection-tracking helper utilities.prometheus/: example Prometheus configurations and adocker-compose.yamlto run a local demo.
Prerequisites:
- Go toolchain (1.20+ recommended)
- Docker & Docker Compose (for the Prometheus demo)
Build locally:
cd $(dirname "$0")
go build -o ridley .Run locally:
# runs the built binary (reads `ridley-config.yaml` from CWD by default)
./ridley
# or run directly with Go during development
go run ./...Prometheus demo using Docker Compose:
cd prometheus
docker-compose up --buildThis will start the example Prometheus instances defined under prometheus/ and point them at the Ridley endpoint as configured in the example configs.
Edit ridley-config.yaml to change listening address/port or other runtime options. The repository includes a simple example; adapt it to your environment as needed.
- Make code changes in Go files.
- Run
go buildto produce an executable. - Use
go vetandgolangci-lint(optional) for extra checks.
Contributions are welcome. Open issues or PRs with bug fixes, improvements, or suggestions.
MIT License