MCPcopy
hub / github.com/prometheus/pushgateway

github.com/prometheus/pushgateway @v1.11.3 sqlite

repository ↗ · DeepWiki ↗ · release v1.11.3 ↗
434 symbols 1,251 edges 27 files 109 documented · 25%
README

Prometheus Pushgateway

[CircleCI][circleci] [Docker Repository on Quay][quay] [Docker Pulls][hub]

The Prometheus Pushgateway exists to allow ephemeral and batch jobs to expose their metrics to Prometheus. Since these kinds of jobs may not exist long enough to be scraped, they can instead push their metrics to a Pushgateway. The Pushgateway then exposes these metrics to Prometheus.

Non-goals

First of all, the Pushgateway is not capable of turning Prometheus into a push-based monitoring system. For a general description of use cases for the Pushgateway, please read When To Use The Pushgateway.

The Pushgateway is explicitly not an aggregator or distributed counter but rather a metrics cache. It does not have statsd-like semantics. The metrics pushed are exactly the same as you would present for scraping in a permanently running program. If you need distributed counting, you could either use the actual statsd in combination with the Prometheus statsd exporter, or have a look at the prom-aggregation-gateway. With more experience gathered, the Prometheus project might one day be able to provide a native solution, separate from or possibly even as part of the Pushgateway.

For machine-level metrics, the textfile collector of the Node exporter is usually more appropriate. The Pushgateway is intended for service-level metrics.

The Pushgateway is not an event store. While you can use Prometheus as a data source for Grafana annotations, tracking something like release events has to happen with some event-logging framework.

A while ago, we decided to not implement a “timeout” or TTL for pushed metrics because almost all proposed use cases turned out to be anti-patterns we strongly discourage. You can follow a more recent discussion on the prometheus-developers mailing list.

Run it

Download binary releases for your platform from the release page and unpack the tarball.

If you want to compile yourself from the sources, you need a working Go setup. Then use the provided Makefile (type make).

For the most basic setup, just start the binary. To change the address to listen on, use the --web.listen-address flag (e.g. "0.0.0.0:9091" or ":9091"). By default, Pushgateway does not persist metrics. However, the --persistence.file flag allows you to specify a file in which the pushed metrics will be persisted (so that they survive restarts of the Pushgateway).

Using Docker

You can deploy the Pushgateway using the prom/pushgateway Docker image.

For example:

docker pull prom/pushgateway

docker run -d -p 9091:9091 prom/pushgateway

More documentation

Please refer to the full length README.md for more documentation.

Extension points exported contracts — how you extend this code

MetricStore (Interface)
MetricStore is the interface to the storage layer for metrics. All its methods must be safe to be called concurrently. [2 …
storage/interface.go

Core symbols most depended-on inside this repo

Error
called by 87
api/v1/api.go
SubmitWriteRequest
called by 30
storage/diskmetricstore.go
newPushTimestampGauge
called by 26
storage/diskmetricstore.go
MetricFamiliesMap
called by 24
testutil/metric_families.go
newPushFailedTimestampGauge
called by 20
storage/diskmetricstore.go
_objectSpread
called by 18
resources/static/bootstrap-4.3.1-dist/js/bootstrap.js
_objectSpread
called by 18
resources/static/bootstrap-4.3.1-dist/js/bootstrap.bundle.js
NewDiskMetricStore
called by 14
storage/diskmetricstore.go

Shape

Function 327
Method 78
Struct 19
TypeAlias 9
Interface 1

Languages

TypeScript60%
Go40%

Modules by API surface

resources/static/bootstrap-4.3.1-dist/js/bootstrap.bundle.js96 symbols
resources/static/jquery-3.7.1.min.js80 symbols
resources/static/bootstrap-4.3.1-dist/js/bootstrap.bundle.min.js45 symbols
asset/assets_vfsdata.go41 symbols
resources/static/bootstrap-4.3.1-dist/js/bootstrap.js29 symbols
storage/diskmetricstore.go27 symbols
api/v1/api.go20 symbols
storage/interface.go18 symbols
storage/diskmetricstore_test.go17 symbols
handler/handler_test.go17 symbols
resources/static/bootstrap-4.3.1-dist/js/bootstrap.min.js10 symbols
main.go6 symbols

Used by 1 indexed graphs manifest dependencies, hub-wide

Dependencies from manifests, versioned

github.com/alecthomas/kingpin/v2v2.4.0 · 1×
github.com/alecthomas/unitsv0.0.0-2024092700094 · 1×
github.com/beorn7/perksv1.0.1 · 1×
github.com/cespare/xxhash/v2v2.3.0 · 1×
github.com/coreos/go-systemd/v22v22.7.0 · 1×
github.com/golang/snappyv1.0.0 · 1×
github.com/grafana/regexpv0.0.0-2025090509391 · 1×
github.com/jpillora/backoffv1.0.0 · 1×
github.com/mdlayher/socketv0.6.1 · 1×

For agents

$ claude mcp add pushgateway \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact