Nomploy Nomad Packs

← All packs

loki v0.1.0

Observability

Grafana Loki — log aggregation — deployed all-in-one with a Grafana Alloy shipper that tails this node's Docker container logs and pushes them to Loki. Single host-networked Nomad job, filesystem storage on a persistent volume. Pairs with the monitoring pack.

nomad-pack run loki --registry nomploy
3 tasks loki 3100alloy 12345 1 volume
Variables 13
values.hcl

Save as values.hcl, edit, then run:

nomad-pack run loki -f values.hcl --registry nomploy
# The name of the Nomad job.
job_name = "loki"

# The Nomad namespace to deploy into.
namespace = "default"

# The datacenters to deploy to.
datacenters = ["*"]

# Loki image. Loki's config schema is version-sensitive — pin a 3.x tag in production (this pack's config targets Loki 3.x: tsdb + schema v13).
loki_image = "grafana/loki:latest"

# Grafana Alloy image (the log shipper; the modern replacement for the now-EOL Promtail).
alloy_image = "grafana/alloy:latest"

# Host port for Loki's HTTP API (push + query). Add this as a Grafana datasource.
loki_port = 3100

# Host port for Alloy's HTTP UI/debug endpoint.
alloy_port = 12345

# Run the bundled Alloy shipper that tails this node's Docker container logs into Loki. Set false to run Loki alone and push from your own agents.
enable_alloy = true

# How long Loki keeps logs, as a Go duration in HOURS (e.g. 168h = 7d, 336h = 14d, 720h = 30d). The compactor enforces it.
retention = "336h"

# Docker named volume for /loki (chunks + index). Loki runs as uid 10001; a prestart task chowns the volume so it can write.
loki_data_volume = "loki_data"

# Placement constraints — pin the job to one node so the local volume stays put and Alloy tails that node's containers. On a nomploy cluster: attribute = "$${meta.nomploy_control_plane}", operator = "=", value = "true".
constraints = []

# Resources for the Loki task.
loki_resources = {
    cpu    = 500
    memory = 512
  }

# Resources for the Alloy shipper task.
alloy_resources = {
    cpu    = 200
    memory = 256
  }
NameTypeDefaultDescription
job_name string
"loki"
The name of the Nomad job.
namespace string
"default"
The Nomad namespace to deploy into.
datacenters list
["*"]
The datacenters to deploy to.
loki_image string
"grafana/loki:latest"
Loki image. Loki's config schema is version-sensitive — pin a 3.x tag in production (this pack's config targets Loki 3.x: tsdb + schema v13).
alloy_image string
"grafana/alloy:latest"
Grafana Alloy image (the log shipper; the modern replacement for the now-EOL Promtail).
loki_port number
3100
Host port for Loki's HTTP API (push + query). Add this as a Grafana datasource.
alloy_port number
12345
Host port for Alloy's HTTP UI/debug endpoint.
enable_alloy bool
true
Run the bundled Alloy shipper that tails this node's Docker container logs into Loki. Set false to run Loki alone and push from your own agents.
retention string
"336h"
How long Loki keeps logs, as a Go duration in HOURS (e.g. 168h = 7d, 336h = 14d, 720h = 30d). The compactor enforces it.
loki_data_volume string
"loki_data"
Docker named volume for /loki (chunks + index). Loki runs as uid 10001; a prestart task chowns the volume so it can write.
constraints list
[]
Placement constraints — pin the job to one node so the local volume stays put and Alloy tails that node's containers. On a nomploy cluster: attribute = "$${meta.nomploy_control_plane}", operator = "=", value = "true".
loki_resources object
{
    cpu    = 500
    memory = 512
  }
Resources for the Loki task.
alloy_resources object
{
    cpu    = 200
    memory = 256
  }
Resources for the Alloy shipper task.
Readme

loki

Grafana Loki — log aggregation — deployed all-in-one: Loki plus a Grafana Alloy shipper that tails this node's Docker container logs and pushes them to Loki. Alloy is the modern replacement for Promtail (which reached end-of-life in Feb 2026). Single host-networked Nomad job, filesystem storage on a persistent volume. This is the logging half of the observability story — pair it with the monitoring pack (metrics).

Usage

nomad-pack registry add nomploy github.com/Nomploy/nomad-packs
nomad-pack run loki --registry nomploy

In nomploy: create a Compose service, type Nomad Pack, pack loki, custom registry github.com/Nomploy/nomad-packs, then Deploy.

Wire it into Grafana

Loki is a data source, not a UI. In Grafana (e.g. from the monitoring pack):

  1. Connections → Data sources → Add data source → Loki
  2. URL: http://127.0.0.1:3100 (same node) or http://<node-ip>:3100
  3. Explore → query {job="docker"} to see container logs, or {container="<name>"} for one container.

Every container's logs arrive labelled job="docker" and container="<name>".

Key variables

Variable Default Notes
loki_image grafana/loki:latest Pin a 3.x tag — Loki's config schema is version-sensitive.
enable_alloy true Bundled log shipper. False = Loki only; push from your own agents.
loki_port 3100 Loki HTTP API (push + query).
alloy_port 12345 Alloy UI/debug.
retention 336h Retention as a Go duration in hours (168h=7d, 720h=30d); enforced by the compactor.
loki_data_volume loki_data Chunks + index. Back up.
constraints [] Pin to a node — Alloy tails that node's containers.

Per-task resources: loki_resources, alloy_resources.

Scope & notes