Skip to content

Commit

Permalink
Changed pushgateway.md (#1083)
Browse files Browse the repository at this point in the history
* Changed pushgateway.md

---------

Signed-off-by: Mallika Muralidharan <mallika.muralidharan@lrz.de>
Signed-off-by: Mallika Muralidharan <mallika-mur>
Signed-off-by: Mallika Muralidharan <179001939+mallika-mur@users.noreply.github.com>
Co-authored-by: Mallika Muralidharan <mallika.muralidharan@lrz.de>
  • Loading branch information
mallika-mur and Mallika Muralidharan authored Jan 28, 2025
1 parent b0a6f12 commit 46eae7b
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions docs/content/exporting/pushgateway.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ weight: 3

The [Pushgateway](https://github.com/prometheus/pushgateway)
allows ephemeral and batch jobs to expose their metrics to Prometheus.
Since Prometheus may not be able to scrape such a target, the targets can
push their metrics to a separate instance of the Pushgateway,
which then exposes these metrics to Prometheus.

```python
from prometheus_client import CollectorRegistry, Gauge, push_to_gateway
Expand All @@ -18,16 +21,20 @@ push_to_gateway('localhost:9091', job='batchA', registry=registry)
A separate registry is used, as the default registry may contain other metrics
such as those from the Process Collector.

Pushgateway functions take a grouping key. `push_to_gateway` replaces metrics
with the same grouping key, `pushadd_to_gateway` only replaces metrics with the
same name and grouping key and `delete_from_gateway` deletes metrics with the
given job and grouping key. See the
Pushgateway functions take a grouping key.
1. `push_to_gateway` replaces metrics
with the same grouping key.
2. `pushadd_to_gateway` only replaces metrics with the
same name and grouping key.
3. `delete_from_gateway` deletes metrics with the
given job and grouping key.
4. `instance_ip_grouping_key` returns a grouping key with the instance label set
to the host's IP address.

See the
[Pushgateway documentation](https://github.com/prometheus/pushgateway/blob/master/README.md)
for more information.

`instance_ip_grouping_key` returns a grouping key with the instance label set
to the host's IP address.

# Handlers for authentication

If the push gateway you are connecting to is protected with HTTP Basic Auth,
Expand Down

0 comments on commit 46eae7b

Please sign in to comment.