Nomploy Nomad Packs

← All packs

pushgateway v0.1.0

Observability

Prometheus Pushgateway — lets short-lived and batch jobs push their metrics to an intermediary that Prometheus then scrapes. Deployed as a stateless host-networked Nomad service. Pairs with the monitoring pack.

nomad-pack run pushgateway --registry nomploy
1 task http 9091 image prom/pushgateway:latest
Variables 7
values.hcl

Save as values.hcl, edit, then run:

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

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

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

# The Pushgateway container image. Pin a tag in production.
image = "prom/pushgateway:latest"

# Host port for the Pushgateway (push API + /metrics for Prometheus to scrape).
port = 9091

# Placement constraints. On a nomploy cluster: attribute = "$${meta.nomploy_control_plane}", operator = "=", value = "true".
constraints = []

# The task resources.
resources = {
    cpu    = 100
    memory = 64
  }
NameTypeDefaultDescription
job_name string
"pushgateway"
The name of the Nomad job.
namespace string
"default"
The Nomad namespace to deploy into.
datacenters list
["*"]
The datacenters to deploy to.
image string
"prom/pushgateway:latest"
The Pushgateway container image. Pin a tag in production.
port number
9091
Host port for the Pushgateway (push API + /metrics for Prometheus to scrape).
constraints list
[]
Placement constraints. On a nomploy cluster: attribute = "$${meta.nomploy_control_plane}", operator = "=", value = "true".
resources object
{
    cpu    = 100
    memory = 64
  }
The task resources.
Readme

pushgateway

Prometheus Pushgateway — an intermediary that lets short-lived and batch jobs push metrics (which Prometheus can't scrape directly because they don't run long enough). Prometheus then scrapes the Pushgateway. Stateless host-networked Nomad service; pairs with the monitoring pack.

Usage

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

Push from a job, then scrape it:

echo "some_metric 42" | curl --data-binary @- http://<node-ip>:9091/metrics/job/my_batch
# in the monitoring pack's prometheus.yml
- job_name: pushgateway
  honor_labels: true
  static_configs:
    - targets: ['127.0.0.1:9091']

Key variables

Variable Default Notes
image prom/pushgateway:latest Pin a tag in production.
port 9091 Push API + /metrics.
constraints [] Placement.
resources cpu 100 / mem 64 Tiny.

Notes