From 9a0f37e71fd21140f21d5e49a3130ab3299dd9ef Mon Sep 17 00:00:00 2001 From: Paweł Dybiec Date: Wed, 17 Apr 2019 17:25:02 +0200 Subject: Inlined grafana config --- composer/grafana/docker-compose.yml | 38 ------------------------- composer/grafana/prometheus/prometheus.yml | 40 --------------------------- composer/monitoring/prometheus/prometheus.yml | 40 +++++++++++++++++++++++++++ docker.yml | 37 ++++++++++++++++++++++++- 4 files changed, 76 insertions(+), 79 deletions(-) delete mode 100644 composer/grafana/docker-compose.yml delete mode 100644 composer/grafana/prometheus/prometheus.yml create mode 100644 composer/monitoring/prometheus/prometheus.yml diff --git a/composer/grafana/docker-compose.yml b/composer/grafana/docker-compose.yml deleted file mode 100644 index 02d2555..0000000 --- a/composer/grafana/docker-compose.yml +++ /dev/null @@ -1,38 +0,0 @@ -version: '2' -volumes: - grafana-storage: - external: - name: grafana_storage -services: - grafana: - image: grafana/grafana - ports: - - "127.0.0.1:5002:3000" - environment: - - GF_SERVER_ROOT_URL=http://grafana.dybiec.info - - GF_SECURITY_ADMIN_PASSWORD=very_secret - volumes: - - "grafana-storage:/var/lib/grafana" - restart: always - prometheus: - expose: - - 9090 - ports: - - "127.0.0.1:5003:9090" - image: prom/prometheus - extra_hosts: - - "dockerhost:172.17.0.1" - volumes: - - "./prometheus:/etc/prometheus/" - restart: always - cadvisor: - image: google/cadvisor - expose: - - 8080 - volumes: - - "/:/rootfs:ro" - - "/var/run:/var/run:ro" - - "/sys:/sys:ro" - - "/var/lib/docker:/var/lib/docker:ro" - - "/dev/disk:/dev/disk:ro" - diff --git a/composer/grafana/prometheus/prometheus.yml b/composer/grafana/prometheus/prometheus.yml deleted file mode 100644 index 2903091..0000000 --- a/composer/grafana/prometheus/prometheus.yml +++ /dev/null @@ -1,40 +0,0 @@ -# my global config -global: - scrape_interval: 15s # Set the scrape interval to every 15 seconds. Default is every 1 minute. - evaluation_interval: 15s # Evaluate rules every 15 seconds. The default is every 1 minute. - # scrape_timeout is set to the global default (10s). - - # Attach these labels to any time series or alerts when communicating with - # external systems (federation, remote storage, Alertmanager). - external_labels: - monitor: 'codelab-monitor' - -# Load rules once and periodically evaluate them according to the global 'evaluation_interval'. -rule_files: - # - "first.rules" - # - "second.rules" - -# A scrape configuration containing exactly one endpoint to scrape: -# Here it's Prometheus itself. -scrape_configs: - # The job name is added as a label `job=` to any timeseries scraped from this config. - - job_name: 'prometheus' - - # metrics_path defaults to '/metrics' - # scheme defaults to 'http'. - - static_configs: - - targets: ['localhost:9090'] - - - job_name: 'docker' - # metrics_path defaults to '/metrics' - # scheme defaults to 'http'. - - static_configs: - - targets: ['dockerhost:9323'] - - job_name: 'cadvisor' - # metrics_path defaults to '/metrics' - # scheme defaults to 'http'. - - static_configs: - - targets: ['cadvisor:8080'] diff --git a/composer/monitoring/prometheus/prometheus.yml b/composer/monitoring/prometheus/prometheus.yml new file mode 100644 index 0000000..2903091 --- /dev/null +++ b/composer/monitoring/prometheus/prometheus.yml @@ -0,0 +1,40 @@ +# my global config +global: + scrape_interval: 15s # Set the scrape interval to every 15 seconds. Default is every 1 minute. + evaluation_interval: 15s # Evaluate rules every 15 seconds. The default is every 1 minute. + # scrape_timeout is set to the global default (10s). + + # Attach these labels to any time series or alerts when communicating with + # external systems (federation, remote storage, Alertmanager). + external_labels: + monitor: 'codelab-monitor' + +# Load rules once and periodically evaluate them according to the global 'evaluation_interval'. +rule_files: + # - "first.rules" + # - "second.rules" + +# A scrape configuration containing exactly one endpoint to scrape: +# Here it's Prometheus itself. +scrape_configs: + # The job name is added as a label `job=` to any timeseries scraped from this config. + - job_name: 'prometheus' + + # metrics_path defaults to '/metrics' + # scheme defaults to 'http'. + + static_configs: + - targets: ['localhost:9090'] + + - job_name: 'docker' + # metrics_path defaults to '/metrics' + # scheme defaults to 'http'. + + static_configs: + - targets: ['dockerhost:9323'] + - job_name: 'cadvisor' + # metrics_path defaults to '/metrics' + # scheme defaults to 'http'. + + static_configs: + - targets: ['cadvisor:8080'] diff --git a/docker.yml b/docker.yml index d1d08b1..642fdc6 100644 --- a/docker.yml +++ b/docker.yml @@ -18,7 +18,42 @@ project_src: composer/gitea - name: grafana docker_service: - project_src: composer/grafana + project_name: grafana + definition: + version: '2' + volumes: + grafana-storage: + external: + name: grafana_storage + services: + grafana: + image: grafana/grafana + ports: + - "127.0.0.1:5002:3000" + environment: + - GF_SERVER_ROOT_URL=http://grafana.dybiec.info + - GF_SECURITY_ADMIN_PASSWORD=very_secret + volumes: + - "grafana-storage:/var/lib/grafana" + restart: always + prometheus: + image: prom/prometheus + expose: [9090] + extra_hosts: + - "dockerhost:172.17.0.1" + volumes: + - "~/composer/monitoring/prometheus:/etc/prometheus/:ro" + restart: always + cadvisor: + image: google/cadvisor + expose: [8080] + volumes: + - "/:/rootfs:ro" + - "/var/run:/var/run:ro" + - "/sys:/sys:ro" + - "/var/lib/docker:/var/lib/docker:ro" + - "/dev/disk:/dev/disk:ro" + restart: always - name: registry docker_service: project_src: composer/registry -- cgit 1.4.1