Skip to content

Deployment

Run the scripts from src/metrics.

Script Purpose
deploy/scripts/build.sh Build metrics-go and metrics-python
deploy/scripts/up.sh Build and start
deploy/scripts/smoke.sh Checks. PHASE is main, failover, load or restart
deploy/scripts/logs.sh Follow logs
deploy/scripts/down.sh Stop. Keeps data
deploy/scripts/purge.sh --yes Delete keys and data

The phases other than main expect you to stop or restart services while they run: for failover stop the proxy or aggregator of l2-001, for load restart services of the first aggregator, and afterwards run restart.

Components of one aggregator

A gRPC proxy accepts packets into a Redis stream. The aggregator processes the stream, keeps open windows in Redis and writes finished windows to TimescaleDB. Redis writes every operation to disk and refuses new data instead of evicting old data.

Kubernetes

KUBE_CONTEXT=my-cluster CLUSTER_ID=cluster-1 STORAGE_CLASS=standard REPO=registry.example/ deploy/scripts/k8s-deploy.sh
Variable Default Meaning
KUBE_CONTEXT required Context of kubectl
CLUSTER_ID required Cluster identifier
NAMESPACE metrics Namespace
STORAGE_CLASS cluster default Storage class
REPO none Prefix of the images
TAG dev Image tag

The script installs the resource definition, a relay, the controller and the operator. The policy comes from deploy/config/policy.json.

Production notes

  • Use grpcs:// between nodes and aggregators outside one cluster.
  • Keep node_policy on allowlist.
  • Back up the keys of the signing agents and the databases.