Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,31 @@ Deployment/runbook documents:

- `docs/docker_multinode_manual_run.md` (manual `docker run`, 4-5 node cluster on multiple VMs, no docker compose)

## Metrics and Grafana

Elastickv now exposes Prometheus metrics on `--metricsAddress` (default: `localhost:9090` in `main.go`, `:9090` in `cmd/server/demo.go`).
Copy link

Copilot AI Mar 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

README states the demo default for --metricsAddress is ":9090", but cmd/server/demo.go actually defaults to "127.0.0.1:9090". Update the README to match the real default (or change the flag default to match the README) to avoid confusing operators.

Suggested change
Elastickv now exposes Prometheus metrics on `--metricsAddress` (default: `localhost:9090` in `main.go`, `:9090` in `cmd/server/demo.go`).
Elastickv now exposes Prometheus metrics on `--metricsAddress` (default: `localhost:9090` in `main.go`, `127.0.0.1:9090` in `cmd/server/demo.go`).

Copilot uses AI. Check for mistakes.

The exported metrics cover:

- DynamoDB-compatible API request rate, success/error split, latency, request/response size, and per-table read/write item counts
- Raft local state, leader identity, current members, commit/applied index, and leader contact lag

Provisioned monitoring assets live under:

- `monitoring/prometheus/prometheus.yml`
- `monitoring/grafana/dashboards/elastickv-cluster-overview.json`
- `monitoring/grafana/provisioning/`
- `monitoring/docker-compose.yml`

To scrape a multi-node deployment, bind `--metricsAddress` to each node's private IP, for example `--metricsAddress "10.0.0.11:9090"`.

Comment on lines +49 to +50
Copy link

Copilot AI Mar 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The README suggests binding --metricsAddress to a private IP for multi-node scraping, but the server enforces --metricsToken for any non-loopback bind (see monitoring.MetricsAddressRequiresToken / startMetricsServer). Please document that requirement here (and how Prometheus should be configured to send the bearer token), otherwise the example configuration will fail to start or be unauthenticated.

Copilot uses AI. Check for mistakes.
For the local 3-node demo, start Grafana and Prometheus with:

```bash
cd monitoring
docker compose up -d
```


## Example Usage

Expand All @@ -41,6 +66,16 @@ To start the server, use the following command:
go run cmd/server/demo.go
```

To expose metrics on a dedicated port:
```bash
go run . \
--address "127.0.0.1:50051" \
--redisAddress "127.0.0.1:6379" \
--dynamoAddress "127.0.0.1:8000" \
--metricsAddress "127.0.0.1:9090" \
--raftId "n1"
```

### Starting the Client

To start the client, use this command:
Expand Down
Loading
Loading