prometheus-pusher
aggregates Prometheus metrics from different endpoints and pushes them to pushgateway
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.
$ go get -u github.com/Showmax/prometheus-pusher
See -help
.
push_interval
[config]
60
pushgateway_url
[config]
, [<resource>]
%s
in the string. That place will be used by the resolved route destination either from route map file or default_route. Can be configured both in [config]
section and separately for each resource.route_map
[config]
, [<resource>]
[config]
section and separately for each resource. Mandatory when using inverse multiplexingdefault_route
[config]
, [<resource>]
,
(without spaces). Metrics will be pushed to all the named destinations. Can be configured both in [config]
section and separately for each resource. Mandatory when using inverse multiplexinghost
[<resource>]
localhost
port
mandatory option
[<resource>]
0
path
[<resource>]
/metrics
ssl
[<resource>]
false
env_labels
[default_env_labels], [service_env_labels]
[<resource>]
s[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
go_ prometheus1
go_debug_ prometheus
mem_ prometheus1
prometheus-pusher
uses logrus with sockrus wrapper for logging.
PRs which enhance, but don't break functionality are welcome. Tests are requires whenever possible.