Skip to content
Merged
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
15 changes: 14 additions & 1 deletion docker/.env.production.template
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@
# Normally written for you by scripts/deploy-validator.sh, which fills in
# DOMAIN, ACME_EMAIL, GENESIS_URL, GENESIS_BUCKET, GENESIS_PATH_PREFIX,
# VALIDATOR_KEY, VALIDATOR_NAME, HOSTNAME, LINERA_VALIDATOR_IMAGE,
# LINERA_CLIENT_IMAGE and NUM_SHARDS.
# LINERA_CLIENT_IMAGE, NUM_SHARDS and COMPOSE_PROFILES.
#
# COMPOSE_PROFILES enables shard-4..7; shard-0..3 always run. Docker Compose
# reads it from this file, so editing it changes how many shards start - which
# will not match the shard list in server.json. Use --num-shards at deploy time
# instead; see docs/DOCKER-COMPOSE.md#changing-the-shard-count.
# See https://docs.infra.linera.net/QUICKSTART/. This template is the
# reference for manual setup and for tuning an existing deployment.
#
Expand Down Expand Up @@ -189,6 +194,14 @@ HOSTNAME=your-domain.example.com
#LIMIT_MEM_SHARD_2=6G
#LIMIT_CPUS_SHARD_3=2.00
#LIMIT_MEM_SHARD_3=6G
#LIMIT_CPUS_SHARD_4=2.00
#LIMIT_MEM_SHARD_4=6G
#LIMIT_CPUS_SHARD_5=2.00
#LIMIT_MEM_SHARD_5=6G
#LIMIT_CPUS_SHARD_6=2.00
#LIMIT_MEM_SHARD_6=6G
#LIMIT_CPUS_SHARD_7=2.00
#LIMIT_MEM_SHARD_7=6G

# Observability stack
#LIMIT_CPUS_ALLOY=0.50
Expand Down
62 changes: 36 additions & 26 deletions docker/alloy-config.river
Original file line number Diff line number Diff line change
Expand Up @@ -17,34 +17,44 @@ prometheus.scrape "proxy_metrics" {
scrape_timeout = "10s"
}

// Discover the shards instead of listing them, so the shard count is
// configurable without editing this file. Mirrors the docker_sd_configs block
// in prometheus.yaml — the two scrape paths must agree on job and shard.
discovery.relabel "shard_metrics" {
targets = discovery.docker.containers.targets

// Every shard service carries linera.shard; nothing else does.
rule {
source_labels = ["__meta_docker_container_label_linera_shard"]
regex = ".+"
action = "keep"
}

rule {
source_labels = ["__meta_docker_network_ip"]
target_label = "__address__"
replacement = "$1:21100"
}

rule {
source_labels = ["__meta_docker_container_label_linera_shard"]
target_label = "shard"
}

rule {
target_label = "job"
replacement = "linera-shard"
}

rule {
target_label = "instance"
replacement = env("HOSTNAME")
}
}

// Scrape metrics from all shard services
prometheus.scrape "shard_metrics" {
targets = [
{
__address__ = "docker-shard-1:21100",
job = "linera-shard",
shard = "0",
instance = env("HOSTNAME"),
},
{
__address__ = "docker-shard-2:21100",
job = "linera-shard",
shard = "1",
instance = env("HOSTNAME"),
},
{
__address__ = "docker-shard-3:21100",
job = "linera-shard",
shard = "2",
instance = env("HOSTNAME"),
},
{
__address__ = "docker-shard-4:21100",
job = "linera-shard",
shard = "3",
instance = env("HOSTNAME"),
},
]
targets = discovery.relabel.shard_metrics.output

forward_to = [otelcol.receiver.prometheus.default.receiver]

Expand Down
2 changes: 2 additions & 0 deletions docker/docker-compose.local-monitoring.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,8 @@ services:
# Prometheus fails to start on a missing rule file.
- ./recording.rules.yaml:/etc/prometheus/recording.rules.yaml:ro
- ${PROMETHEUS_DATA_DIR:-./data/prometheus}:/prometheus
# Read-only: docker_sd_configs discovers the shards through it.
- /var/run/docker.sock:/var/run/docker.sock:ro
ports:
- "${PROMETHEUS_PORT:-9090}:9090"
deploy:
Expand Down
13 changes: 13 additions & 0 deletions docker/docker-compose.remote-scylla.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,16 @@ services:
shard-3:
extra_hosts:
- "scylla=${SCYLLA_HOST:?set SCYLLA_HOST to the address of your ScyllaDB host}"

shard-4:
extra_hosts:
- "scylla=${SCYLLA_HOST:?set SCYLLA_HOST to the address of your ScyllaDB host}"
shard-5:
extra_hosts:
- "scylla=${SCYLLA_HOST:?set SCYLLA_HOST to the address of your ScyllaDB host}"
shard-6:
extra_hosts:
- "scylla=${SCYLLA_HOST:?set SCYLLA_HOST to the address of your ScyllaDB host}"
shard-7:
extra_hosts:
- "scylla=${SCYLLA_HOST:?set SCYLLA_HOST to the address of your ScyllaDB host}"
Loading
Loading