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.
Save as values.hcl, edit, then run:
# 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
}
| Name | Type | Default | Description |
|---|---|---|---|
| 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. |
No variables match.
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.
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']
| 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. |
--persistence.file + a volume if you
need them to survive a restart; not configured here).honor_labels: true on the scrape so pushed job/instance labels win.