Skip to content

Commit 46eae7b

Browse files
mallika-murMallika Muralidharan
and
Mallika Muralidharan
authored
Changed pushgateway.md (#1083)
* Changed pushgateway.md --------- Signed-off-by: Mallika Muralidharan <[email protected]> Signed-off-by: Mallika Muralidharan <mallika-mur> Signed-off-by: Mallika Muralidharan <[email protected]> Co-authored-by: Mallika Muralidharan <[email protected]>
1 parent b0a6f12 commit 46eae7b

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

docs/content/exporting/pushgateway.md

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ weight: 3
55

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

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

21-
Pushgateway functions take a grouping key. `push_to_gateway` replaces metrics
22-
with the same grouping key, `pushadd_to_gateway` only replaces metrics with the
23-
same name and grouping key and `delete_from_gateway` deletes metrics with the
24-
given job and grouping key. See the
24+
Pushgateway functions take a grouping key.
25+
1. `push_to_gateway` replaces metrics
26+
with the same grouping key.
27+
2. `pushadd_to_gateway` only replaces metrics with the
28+
same name and grouping key.
29+
3. `delete_from_gateway` deletes metrics with the
30+
given job and grouping key.
31+
4. `instance_ip_grouping_key` returns a grouping key with the instance label set
32+
to the host's IP address.
33+
34+
See the
2535
[Pushgateway documentation](https://github.com/prometheus/pushgateway/blob/master/README.md)
2636
for more information.
2737

28-
`instance_ip_grouping_key` returns a grouping key with the instance label set
29-
to the host's IP address.
30-
3138
# Handlers for authentication
3239

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

0 commit comments

Comments
 (0)