Showmax / prometheus-pusher

Scrapes local metric from local exporters and pushes them towards Prometheus pushgateway
http://tech.showmax.com
Other
36 stars 16 forks source link

prometheus-pusher

prometheus-pusher aggregates Prometheus metrics from different endpoints and pushes them to pushgateway

Architecture

prometheus-pusher Architecture

prometheus-pusher fetches metrics data from configured resources in specified interval and does inverse multiplexing on each metric, where destination for each one is decided by the prefix of metric name specified in route map file.

Installation

$ go get -u github.com/Showmax/prometheus-pusher

Usage

See -help.

Configuration

Example config

[config]
push_interval = 60                 # Default (in seconds)
pushgateway_url = "http://%s.somedomain.com:9092" # Default
route_map = "/path/to/route1.map"
default_route = "prometheus1,prometheus2"

[resource1]
host = "localhost" # Default
path = "/metrics"  # Default
ssl = false        # Default
port = 9111

[resource2]
pushgateway_url = "http://%s.somedomain.com:9091/"
route_map = "/path/to/route2.map"
default_route = "prometheus"
port = 9112

Example route map

go_ prometheus1
go_debug_ prometheus
mem_ prometheus1

Logging

prometheus-pusher uses logrus with sockrus wrapper for logging.

Contributing

PRs which enhance, but don't break functionality are welcome. Tests are requires whenever possible.