Add example exporting metrics to Prometheus

This commit is contained in:
IamTheFij 2019-03-08 12:29:55 -08:00
parent 5783190f58
commit 6d93aed7f1
5 changed files with 55 additions and 1 deletions

View File

@ -5,3 +5,4 @@
*.so *.so
**/__pycache__/ **/__pycache__/
scripts/README.md scripts/README.md
examples/

View File

@ -0,0 +1,3 @@
# Example Prometheus Exporter
An example configuration exporting Minitor stats to Prometheus

View File

@ -0,0 +1,33 @@
version: '2'
services:
prom:
image: prom/prometheus
ports:
- "9090:9090"
volumes:
- ./prometheus.yml:/etc/prometheus/prometheus.yml
grafana:
image: grafana/grafana
ports:
- "8000:3000"
volumes:
- /var/lib/grafana
cadvisor:
image: google/cadvisor
ports:
- "8088:8080"
volumes:
- /:/rootfs:ro
- /var/run:/var/run:rw
- /sys:/sys:ro
- /var/lib/docker:/var/lib/docker:ro
minitor:
build: ../../
ports:
- "8080:8080"
command: [ "--metrics", "-v" ]
volumes:
- ../../config.yml:/app/config.yml

View File

@ -0,0 +1,16 @@
---
global:
scrape_interval: 30s
scrape_configs:
- job_name: prometheus
scrape_interval: 5s
static_configs:
- targets: ['localhost:9090']
- job_name: cadvisor
static_configs:
- targets: ['cadvisor:8080']
- job_name: minitor
metrics_path: /
static_configs:
- targets: ['minitor:8080']

View File

@ -39,8 +39,9 @@ setup(
packages=find_packages(exclude=[ packages=find_packages(exclude=[
'contrib', 'contrib',
'docs', 'docs',
'tests', 'examples',
'scripts', 'scripts',
'tests',
]), ]),
install_requires=[ install_requires=[
'prometheus_client', 'prometheus_client',