Skip to content
This repository has been archived by the owner on Mar 25, 2022. It is now read-only.

Commit

Permalink
Merge pull request #93 from ipfs/monitoring-fixes
Browse files Browse the repository at this point in the history
Monitoring fixes
  • Loading branch information
jbenet committed Sep 21, 2015
2 parents 4502e6f + 91754c7 commit a1069e1
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 13 deletions.
4 changes: 3 additions & 1 deletion solarnet/metrics.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@

- hosts: metrics
vars:
gateway_group: gateway
node_targets: "{{ cjdns_identities.keys() }}"
gateway_targets: "{{ groups.gateway }}"
storage_targets: "{{ groups.storage }}"
pre_tasks:
- include_vars: secrets_plaintext/secrets.yml
handlers:
Expand Down
8 changes: 7 additions & 1 deletion solarnet/roles/docker/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
# XXX migration
- lineinfile:
dest: /etc/default/docker
line: 'DOCKER_OPTS=--log-driver=none'
line: 'DOCKER_OPTS="--log-driver=none"'
state: absent
notify:
- restart docker
Expand All @@ -35,3 +35,9 @@
state: present
notify:
- restart docker

- name: docker service
service:
name: docker
enabled: yes
state: started
1 change: 1 addition & 0 deletions solarnet/roles/metrics/files/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ WORKDIR /prometheus
ENTRYPOINT [ "/bin/prometheus" ]
CMD [ "-config.file=/etc/prometheus/prometheus.yml", \
"-storage.local.path=/prometheus", \
"-storage.local.memory-chunks=512288", \
"-web.path-prefix=/prometheus", \
"-web.console.libraries=/etc/prometheus/console_libraries", \
"-web.console.templates=/etc/prometheus/consoles" ]
23 changes: 13 additions & 10 deletions solarnet/roles/metrics/templates/prometheus.yml.j2
Original file line number Diff line number Diff line change
@@ -1,27 +1,30 @@
---
global:
scrape_interval: 15s
scrape_timeout: 10s
evaluation_interval: 15s
labels:
monitor: '{{ ansible_hostname }}'

scrape_configs:
- job_name: 'ipfs'
scrape_interval: 5s
scrape_timeout: 10s
- job_name: 'gateway'
metrics_path: '/debug/metrics/prometheus'
target_groups:
- targets:
{% for hostname in groups[gateway_group] %}
{% for hostname in gateway_targets %}
- '[{{ cjdns_identities[hostname].ipv6 }}]:5001'
{% endfor %}

- job_name: 'node'
scrape_interval: 5s
scrape_timeout: 10s
- job_name: 'storage'
metrics_path: '/debug/metrics/prometheus'
target_groups:
- targets:
{% for hostname in storage_targets %}
- '[{{ cjdns_identities[hostname].ipv6 }}]:5001'
{% endfor %}

- job_name: 'host'
metrics_path: '/metrics'
target_groups:
- targets:
{% for hostname in cjdns_identities.keys() %}
{% for hostname in node_targets %}
- '[{{ cjdns_identities[hostname].ipv6 }}]:9100'
{% endfor %}
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ stop on starting rc RUNLEVEL=[016]
respawn
respawn limit unlimited

exec /usr/bin/node_exporter --web.listen-address="127.0.0.1:9100"
exec /usr/bin/node_exporter --web.listen-address="127.0.0.1:9100" -collectors.enabled=filesystem,netdev

0 comments on commit a1069e1

Please sign in to comment.