Skip to content

Commit

Permalink
update docker compose and README
Browse files Browse the repository at this point in the history
  • Loading branch information
yunlzheng committed May 9, 2017
1 parent 2ffec0d commit dc65090
Show file tree
Hide file tree
Showing 2 changed files with 82 additions and 0 deletions.
80 changes: 80 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,82 @@
# prometheus-pusher

collection prometheus data and push to pushgateway

## Architecture

![](http://7pn5d3.com1.z0.glb.clouddn.com/prometheus_pusher.png)

## Feature

* Support Prometheus Config File
* Support Prometheus Service Discovery

## How To Use

Prepare prometheus config file **/ect/prom-conf/prometheus.yml**

```
global:
scrape_interval: 15s
evaluation_interval: 15s
external_labels:
monitor: 'exporter-metrics'
scrape_configs:
- job_name: 'HostsMetrics'
dns_sd_configs:
- names:
- node-exporter
refresh_interval: 15s
type: A
port: 9100
- job_name: 'ContainerMetrics'
static_configs:
- targets:
- 'rancher-server:9108'
- job_name: 'RancherServerMetrics'
dns_sd_configs:
- names:
- cadvisor
refresh_interval: 15s
type: A
port: 8080
- job_name: 'RancherApi'
dns_sd_configs:
- names:
- 'prometheus-rancher-exporter'
refresh_interval: 15s
type: A
port: 9173
- job_name: 'Prometheus'
static_configs:
- targets:
- '127.0.0.1:9090'
```

work with docker-compose

> Note: you should set the environment variable of PushGateway address
```
version: '2'
services:
pusher:
image: wisecity/prometheus-pusher
environment:
PUSH_GATEWAY: http://pushgateway.example.org:9091
volumes:
- /ect/prom-conf:/etc/prom-conf
entrypoint:
- /bin/prometheus_pusher
- -config.file
- /etc/prom-conf/prometheus.yml
```



2 changes: 2 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ version: '2'
services:
pusher:
image: wisecity/prometheus-pusher
environment:
PUSH_GATEWAY: http://pushgateway.example.org:9091
volumes_from:
- conf
entrypoint:
Expand Down

0 comments on commit dc65090

Please sign in to comment.