Pushgateway

From wikinotes
Revision as of 01:49, 26 February 2022 by Will (talk | contribs) (Created page with "The push gateway lets you push metrics to prometheus using a REST API. = Documentation = <blockquote> {| class="wikitable" |- | official docs || https://github.com/prometheus...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

The push gateway lets you push metrics to prometheus using a REST API.

Documentation

official docs https://github.com/prometheus/pushgateway/blob/master/README.md

Usage

# emit metric without instance
echo "some_metric{name="foo"} 1" | curl --data-binary @- http://${IPADDR}:9091/metrics/job/${YOUR_JOB_NAME}

# emit metric with instance
cat <<EOF | curl --data-binary @- http://${IPADDR}:9091/metrics/job/${YOUR_JOB_NAME}/instance/${YOUR_INSTANCE}
metric_abc 1.1
metric_def 2.2
EOF